All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/RFT 00/42] explode header files
@ 2013-04-13 23:53 Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 01/42] backports: average: backport efficiency improvements Johannes Berg
                   ` (44 more replies)
  0 siblings, 45 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports

As we discussed recently, it's better to explode our backport
header files into the names that the kernel uses instead of
pre-including half the world from the gcc command line. Doing
so is obviously a lot of work and can't really be done in a
way that would continue working inbetween the patch series,
so I'm doing it per kernel version (or rather compat-x.y.z
header.)

Before I rebased onto the media drivers this was pretty much
passing ckmake --allyesconfig, now minor issues could have
come up that I need to solve, but generally this should be
fine. I did solve the issues that I saw in ckmake before.

johannes


^ permalink raw reply	[flat|nested] 46+ messages in thread

* [RFC/RFT 01/42] backports: average: backport efficiency improvements
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 02/42] backports: fix includes in backport code Johannes Berg
                   ` (43 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This is what we get for not copying it directly :-)
For now, backport af556884359 manually.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/compat/average.c        | 20 ++++++++++++--------
 backport/include/linux/average.h |  2 +-
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/backport/compat/average.c b/backport/compat/average.c
index 37cbfd6..b7a51a1 100644
--- a/backport/compat/average.c
+++ b/backport/compat/average.c
@@ -11,23 +11,27 @@
 #include <linux/average.h>
 #include <linux/module.h>
 #include <linux/bug.h>
+#include <linux/log2.h>
 
 /**
  * ewma_init() - Initialize EWMA parameters
  * @avg: Average structure
  * @factor: Factor to use for the scaled up internal value. The maximum value
- *	of averages can be ULONG_MAX/(factor*weight).
+ *	of averages can be ULONG_MAX/(factor*weight). For performance reasons
+ *	factor has to be a power of 2.
  * @weight: Exponential weight, or decay rate. This defines how fast the
- *	influence of older values decreases. Has to be bigger than 1.
+ *	influence of older values decreases. For performance reasons weight has
+ *	to be a power of 2.
  *
  * Initialize the EWMA parameters for a given struct ewma @avg.
  */
 void ewma_init(struct ewma *avg, unsigned long factor, unsigned long weight)
 {
-	WARN_ON(weight <= 1 || factor == 0);
+	WARN_ON(!is_power_of_2(weight) || !is_power_of_2(factor));
+
+	avg->weight = ilog2(weight);
+	avg->factor = ilog2(factor);
 	avg->internal = 0;
-	avg->weight = weight;
-	avg->factor = factor;
 }
 EXPORT_SYMBOL_GPL(ewma_init);
 
@@ -41,9 +45,9 @@ EXPORT_SYMBOL_GPL(ewma_init);
 struct ewma *ewma_add(struct ewma *avg, unsigned long val)
 {
 	avg->internal = avg->internal  ?
-		(((avg->internal * (avg->weight - 1)) +
-			(val * avg->factor)) / avg->weight) :
-		(val * avg->factor);
+		(((avg->internal << avg->weight) - avg->internal) +
+			(val << avg->factor)) >> avg->weight :
+		(val << avg->factor);
 	return avg;
 }
 EXPORT_SYMBOL_GPL(ewma_add);
diff --git a/backport/include/linux/average.h b/backport/include/linux/average.h
index 16eff0d..2d6210e 100644
--- a/backport/include/linux/average.h
+++ b/backport/include/linux/average.h
@@ -29,6 +29,6 @@ extern struct ewma *ewma_add(struct ewma *avg, unsigned long val);
  */
 static inline unsigned long ewma_read(const struct ewma *avg)
 {
-	return DIV_ROUND_CLOSEST(avg->internal, avg->factor);
+	return avg->internal >> avg->factor;
 }
 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37)) */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 02/42] backports: fix includes in backport code
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 01/42] backports: average: backport efficiency improvements Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 03/42] backports: patch tracing for older kernels Johannes Berg
                   ` (42 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

A number of includes were missing in the backport(ed)
code since the command line includes almost everything.
As that's going to change, add missing includes to the
code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/compat/compat-2.6.26.c  | 3 ++-
 backport/compat/compat-2.6.27.c  | 2 +-
 backport/compat/compat-2.6.28.c  | 4 +++-
 backport/compat/compat-2.6.32.c  | 1 +
 backport/compat/compat-2.6.33.c  | 3 +++
 backport/compat/compat-2.6.34.c  | 3 +--
 backport/compat/compat-2.6.35.c  | 5 +++++
 backport/compat/compat-2.6.37.c  | 2 ++
 backport/compat/compat-2.6.39.c  | 1 +
 backport/compat/compat-3.5.c     | 1 +
 backport/compat/compat-3.7.c     | 2 ++
 backport/compat/compat-3.9.c     | 1 +
 backport/compat/pm_qos_params.c  | 1 +
 backport/compat/user_namespace.c | 1 +
 14 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/backport/compat/compat-2.6.26.c b/backport/compat/compat-2.6.26.c
index f471506..5193886 100644
--- a/backport/compat/compat-2.6.26.c
+++ b/backport/compat/compat-2.6.26.c
@@ -13,7 +13,8 @@
  * Copyright (c) 2006-2007 Greg Kroah-Hartman <greg@kroah.com>
  * Copyright (c) 2006-2007 Novell Inc.
  */
-
+#include <linux/device.h>
+#include <net/sock.h>
 #include <net/compat.h>
 
 /* 2.6.24 does not have the struct kobject with a name */
diff --git a/backport/compat/compat-2.6.27.c b/backport/compat/compat-2.6.27.c
index 084bdf6..79bbed5 100644
--- a/backport/compat/compat-2.6.27.c
+++ b/backport/compat/compat-2.6.27.c
@@ -7,7 +7,7 @@
  *
  * Compatibility file for Linux wireless for kernels 2.6.27
  */
-
+#include <linux/debugfs.h>
 #include <linux/compat.h>
 #include <linux/pci.h>
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
diff --git a/backport/compat/compat-2.6.28.c b/backport/compat/compat-2.6.28.c
index 0ae8f46..451e614 100644
--- a/backport/compat/compat-2.6.28.c
+++ b/backport/compat/compat-2.6.28.c
@@ -11,6 +11,7 @@
 #include <linux/compat.h>
 #include <linux/usb.h>
 #include <linux/tty.h>
+#include <linux/skbuff.h>
 #include <asm/poll.h>
 
 /* 2.6.28 compat code goes here */
@@ -87,7 +88,8 @@ EXPORT_SYMBOL_GPL(usb_poison_urb);
 #endif /* CONFIG_USB */
 
 #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
-
+#include <pcmcia/cistpl.h>
+#include <pcmcia/cs_types.h>
 #include <pcmcia/ds.h>
 struct pcmcia_cfg_mem {
 	tuple_t tuple;
diff --git a/backport/compat/compat-2.6.32.c b/backport/compat/compat-2.6.32.c
index b5a66a8..68ab03e 100644
--- a/backport/compat/compat-2.6.32.c
+++ b/backport/compat/compat-2.6.32.c
@@ -10,6 +10,7 @@
 
 #include <linux/compat.h>
 #include <linux/netdevice.h>
+#include <linux/time.h>
 
 int __dev_addr_add(struct dev_addr_list **list, int *count,
 		   void *addr, int alen, int glbl)
diff --git a/backport/compat/compat-2.6.33.c b/backport/compat/compat-2.6.33.c
index f584b85..565836c 100644
--- a/backport/compat/compat-2.6.33.c
+++ b/backport/compat/compat-2.6.33.c
@@ -13,6 +13,9 @@
 #include <linux/usb.h>
 #include <linux/pm_runtime.h>
 #include <linux/platform_device.h>
+#include <pcmcia/cs_types.h>
+#include <pcmcia/cistpl.h>
+#include <pcmcia/ds.h>
 
 #ifdef CONFIG_USB_SUSPEND
 /**
diff --git a/backport/compat/compat-2.6.34.c b/backport/compat/compat-2.6.34.c
index 4b23c81..031d169 100644
--- a/backport/compat/compat-2.6.34.c
+++ b/backport/compat/compat-2.6.34.c
@@ -9,8 +9,7 @@
  */
 
 #include <linux/mmc/sdio_func.h>
-
-#include "compat-2.6.34.h"
+#include <linux/seq_file.h>
 
 static mmc_pm_flag_t backport_mmc_pm_flags;
 
diff --git a/backport/compat/compat-2.6.35.c b/backport/compat/compat-2.6.35.c
index 20fee85..cd556d3 100644
--- a/backport/compat/compat-2.6.35.c
+++ b/backport/compat/compat-2.6.35.c
@@ -11,6 +11,11 @@
 
 #include <linux/compat.h>
 #include <linux/ctype.h>
+#include <linux/netdevice.h>
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/uaccess.h>
+#include <net/sch_generic.h>
 
 #ifdef CONFIG_RPS
 int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq)
diff --git a/backport/compat/compat-2.6.37.c b/backport/compat/compat-2.6.37.c
index 9f722a6..dadc0ac 100644
--- a/backport/compat/compat-2.6.37.c
+++ b/backport/compat/compat-2.6.37.c
@@ -13,6 +13,8 @@
 #include <net/sock.h>
 #include <linux/nsproxy.h>
 #include <linux/vmalloc.h>
+#include <net/genetlink.h>
+#include <linux/leds.h>
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
 static const void *net_current_ns(void)
diff --git a/backport/compat/compat-2.6.39.c b/backport/compat/compat-2.6.39.c
index 5bb9322..0e36da8 100644
--- a/backport/compat/compat-2.6.39.c
+++ b/backport/compat/compat-2.6.39.c
@@ -11,6 +11,7 @@
 #include <linux/compat.h>
 #include <linux/tty.h>
 #include <linux/sched.h>
+#include <linux/module.h>
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 /*
diff --git a/backport/compat/compat-3.5.c b/backport/compat/compat-3.5.c
index 9cc8456..0355ed1 100644
--- a/backport/compat/compat-3.5.c
+++ b/backport/compat/compat-3.5.c
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/highuid.h>
 #include <linux/ktime.h>
+#include <linux/hrtimer.h>
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
 #include <linux/device.h>
diff --git a/backport/compat/compat-3.7.c b/backport/compat/compat-3.7.c
index 226d136..284e8dc 100644
--- a/backport/compat/compat-3.7.c
+++ b/backport/compat/compat-3.7.c
@@ -10,6 +10,8 @@
 
 #include <linux/workqueue.h>
 #include <linux/export.h>
+#include <linux/pci.h>
+#include <linux/pci_regs.h>
 
 bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
 		      unsigned long delay)
diff --git a/backport/compat/compat-3.9.c b/backport/compat/compat-3.9.c
index 56c40d3..0656015 100644
--- a/backport/compat/compat-3.9.c
+++ b/backport/compat/compat-3.9.c
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/scatterlist.h>
 #include <linux/device.h>
+#include <linux/err.h>
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
 /**
diff --git a/backport/compat/pm_qos_params.c b/backport/compat/pm_qos_params.c
index 42785ce..1f000ab 100644
--- a/backport/compat/pm_qos_params.c
+++ b/backport/compat/pm_qos_params.c
@@ -1,3 +1,4 @@
+#include <net/sock.h>
 #include <net/compat.h>
 
 /* This is the backport of pm-qos params for kernels <= 2.6.25 */
diff --git a/backport/compat/user_namespace.c b/backport/compat/user_namespace.c
index 0dcc4bc..288efc0 100644
--- a/backport/compat/user_namespace.c
+++ b/backport/compat/user_namespace.c
@@ -11,6 +11,7 @@
 
 #include <linux/module.h>
 #include <linux/highuid.h>
+#include <linux/uidgid.h>
 #include <linux/user_namespace.h>
 
 #ifdef CONFIG_USER_NS
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 03/42] backports: patch tracing for older kernels
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 01/42] backports: average: backport efficiency improvements Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 02/42] backports: fix includes in backport code Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 04/42] backports: move header files Johannes Berg
                   ` (41 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

For some reason the tracing on older kernels requires
the tracing to be declared before it's defined; it's
broken when the trace header is only included to create
the tracepoints.

Since new kernels don't, add patches for the two places
that rely on the new behaviour.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 .../network/74-define-tracing/ath6kl.patch                     | 10 ++++++++++
 .../network/74-define-tracing/cfg80211.patch                   |  8 ++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 patches/collateral-evolutions/network/74-define-tracing/ath6kl.patch
 create mode 100644 patches/collateral-evolutions/network/74-define-tracing/cfg80211.patch

diff --git a/patches/collateral-evolutions/network/74-define-tracing/ath6kl.patch b/patches/collateral-evolutions/network/74-define-tracing/ath6kl.patch
new file mode 100644
index 0000000..5910f54
--- /dev/null
+++ b/patches/collateral-evolutions/network/74-define-tracing/ath6kl.patch
@@ -0,0 +1,10 @@
+--- a/drivers/net/wireless/ath/ath6kl/trace.c
++++ b/drivers/net/wireless/ath/ath6kl/trace.c
+@@ -16,6 +16,7 @@
+ 
+ #include <linux/module.h>
+ 
++#include "trace.h"
+ #define CREATE_TRACE_POINTS
+ #include "trace.h"
+ 
diff --git a/patches/collateral-evolutions/network/74-define-tracing/cfg80211.patch b/patches/collateral-evolutions/network/74-define-tracing/cfg80211.patch
new file mode 100644
index 0000000..eeab23d
--- /dev/null
+++ b/patches/collateral-evolutions/network/74-define-tracing/cfg80211.patch
@@ -0,0 +1,8 @@
+--- a/net/wireless/trace.c
++++ b/net/wireless/trace.c
+@@ -1,4 +1,5 @@
+ #include <linux/module.h>
++#include "trace.h"
+ 
+ #ifndef __CHECKER__
+ #define CREATE_TRACE_POINTS
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 04/42] backports: move header files
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (2 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 03/42] backports: patch tracing for older kernels Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 05/42] backports: fix dma-buf backport patch Johannes Berg
                   ` (40 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This first step in reorganising the header files moves all the
header files into a new backport-include/ directory that gets
priority over the regular include/ where we copy the files we
want to backport from the kernel. This will help split all the
header files into logical units.

While at it, move and rename compat_2.6.h and compat_autoconf.h
to backport/backport.h and backport/autoconf.h respectively.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/.gitignore                                            |  2 +-
 backport/Makefile.kernel                                       |  3 ++-
 backport/Makefile.real                                         |  8 ++++----
 .../compat-2.6.h => backport-include/backport/backport.h}      | 10 +++++-----
 .../backport_checks.h => backport-include/backport/checks.h}   |  0
 backport/{include => backport-include}/crypto/aes.h            |  0
 backport/{include => backport-include}/linux/atomic.h          |  0
 backport/{include => backport-include}/linux/average.h         |  0
 backport/{include => backport-include}/linux/bitops.h          |  0
 backport/{include => backport-include}/linux/compat-2.6.14.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.18.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.19.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.20.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.21.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.22.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.23.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.24.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.25.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.26.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.27.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.28.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.29.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.30.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.31.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.32.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.33.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.34.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.35.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.36.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.37.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.38.h   |  0
 backport/{include => backport-include}/linux/compat-2.6.39.h   |  0
 backport/{include => backport-include}/linux/compat-3.0.h      |  0
 backport/{include => backport-include}/linux/compat-3.1.h      |  0
 backport/{include => backport-include}/linux/compat-3.10.h     |  0
 backport/{include => backport-include}/linux/compat-3.2.h      |  0
 backport/{include => backport-include}/linux/compat-3.3.h      |  0
 backport/{include => backport-include}/linux/compat-3.4.h      |  0
 backport/{include => backport-include}/linux/compat-3.5.h      |  0
 backport/{include => backport-include}/linux/compat-3.6.h      |  0
 backport/{include => backport-include}/linux/compat-3.7.h      |  0
 backport/{include => backport-include}/linux/compat-3.8.h      |  0
 backport/{include => backport-include}/linux/compat-3.9.h      |  0
 backport/{include => backport-include}/linux/cordic.h          |  0
 backport/{include => backport-include}/linux/crc8.h            |  0
 backport/{include => backport-include}/linux/export.h          |  0
 backport/{include => backport-include}/linux/gpio.h            |  0
 backport/{include => backport-include}/linux/kfifo.h           |  0
 backport/{include => backport-include}/linux/kmemleak.h        |  0
 backport/{include => backport-include}/linux/math64.h          |  0
 backport/{include => backport-include}/linux/of.h              |  0
 backport/{include => backport-include}/linux/olpc-ec.h         |  0
 backport/{include => backport-include}/linux/pci-aspm.h        |  0
 backport/{include => backport-include}/linux/pm_qos.h          |  0
 backport/{include => backport-include}/linux/pm_qos_params.h   |  0
 backport/{include => backport-include}/linux/pm_runtime.h      |  0
 backport/{include => backport-include}/linux/printk.h          |  0
 backport/{include => backport-include}/linux/rfkill.h          |  0
 backport/{include => backport-include}/linux/semaphore.h       |  0
 backport/{include => backport-include}/linux/tracepoint.h      |  0
 backport/{include => backport-include}/linux/u64_stats_sync.h  |  0
 backport/{include => backport-include}/linux/uidgid.h          |  0
 .../{include => backport-include}/linux/unaligned/access_ok.h  |  0
 .../linux/unaligned/be_byteshift.h                             |  0
 .../{include => backport-include}/linux/unaligned/be_memmove.h |  0
 .../{include => backport-include}/linux/unaligned/be_struct.h  |  0
 .../{include => backport-include}/linux/unaligned/generic.h    |  0
 .../linux/unaligned/le_byteshift.h                             |  0
 .../{include => backport-include}/linux/unaligned/le_memmove.h |  0
 .../{include => backport-include}/linux/unaligned/le_struct.h  |  0
 .../{include => backport-include}/linux/unaligned/memmove.h    |  0
 .../linux/unaligned/packed_struct.h                            |  0
 backport/{include => backport-include}/linux/vga_switcheroo.h  |  0
 backport/{include => backport-include}/linux/wireless.h        |  0
 backport/{include => backport-include}/net/codel.h             |  0
 backport/{include => backport-include}/net/flow_keys.h         |  0
 backport/{include => backport-include}/net/net_namespace.h     |  0
 backport/{include => backport-include}/pcmcia/cistpl.h         |  0
 backport/{include => backport-include}/trace/define_trace.h    |  0
 devel/doc/makefile-operation                                   |  2 +-
 gentree.py                                                     |  2 +-
 81 files changed, 14 insertions(+), 13 deletions(-)
 rename backport/{include/linux/compat-2.6.h => backport-include/backport/backport.h} (94%)
 rename backport/{include/linux/backport_checks.h => backport-include/backport/checks.h} (100%)
 rename backport/{include => backport-include}/crypto/aes.h (100%)
 rename backport/{include => backport-include}/linux/atomic.h (100%)
 rename backport/{include => backport-include}/linux/average.h (100%)
 rename backport/{include => backport-include}/linux/bitops.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.14.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.18.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.19.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.20.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.21.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.22.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.23.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.24.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.25.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.26.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.27.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.28.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.29.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.30.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.31.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.32.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.33.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.34.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.35.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.36.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.37.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.38.h (100%)
 rename backport/{include => backport-include}/linux/compat-2.6.39.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.0.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.1.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.10.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.2.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.3.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.4.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.5.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.6.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.7.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.8.h (100%)
 rename backport/{include => backport-include}/linux/compat-3.9.h (100%)
 rename backport/{include => backport-include}/linux/cordic.h (100%)
 rename backport/{include => backport-include}/linux/crc8.h (100%)
 rename backport/{include => backport-include}/linux/export.h (100%)
 rename backport/{include => backport-include}/linux/gpio.h (100%)
 rename backport/{include => backport-include}/linux/kfifo.h (100%)
 rename backport/{include => backport-include}/linux/kmemleak.h (100%)
 rename backport/{include => backport-include}/linux/math64.h (100%)
 rename backport/{include => backport-include}/linux/of.h (100%)
 rename backport/{include => backport-include}/linux/olpc-ec.h (100%)
 rename backport/{include => backport-include}/linux/pci-aspm.h (100%)
 rename backport/{include => backport-include}/linux/pm_qos.h (100%)
 rename backport/{include => backport-include}/linux/pm_qos_params.h (100%)
 rename backport/{include => backport-include}/linux/pm_runtime.h (100%)
 rename backport/{include => backport-include}/linux/printk.h (100%)
 rename backport/{include => backport-include}/linux/rfkill.h (100%)
 rename backport/{include => backport-include}/linux/semaphore.h (100%)
 rename backport/{include => backport-include}/linux/tracepoint.h (100%)
 rename backport/{include => backport-include}/linux/u64_stats_sync.h (100%)
 rename backport/{include => backport-include}/linux/uidgid.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/access_ok.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/be_byteshift.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/be_memmove.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/be_struct.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/generic.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/le_byteshift.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/le_memmove.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/le_struct.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/memmove.h (100%)
 rename backport/{include => backport-include}/linux/unaligned/packed_struct.h (100%)
 rename backport/{include => backport-include}/linux/vga_switcheroo.h (100%)
 rename backport/{include => backport-include}/linux/wireless.h (100%)
 rename backport/{include => backport-include}/net/codel.h (100%)
 rename backport/{include => backport-include}/net/flow_keys.h (100%)
 rename backport/{include => backport-include}/net/net_namespace.h (100%)
 rename backport/{include => backport-include}/pcmcia/cistpl.h (100%)
 rename backport/{include => backport-include}/trace/define_trace.h (100%)

diff --git a/backport/.gitignore b/backport/.gitignore
index b3c3260..c906800 100644
--- a/backport/.gitignore
+++ b/backport/.gitignore
@@ -12,7 +12,7 @@ Kconfig.versions
 *.tmp
 *.ver
 modules.order
-include/linux/compat_autoconf.h
+backport-include/backport/autoconf.h
 modules
 kconfig/mconf
 kconfig/conf
diff --git a/backport/Makefile.kernel b/backport/Makefile.kernel
index 096e80c..a58442a 100644
--- a/backport/Makefile.kernel
+++ b/backport/Makefile.kernel
@@ -4,10 +4,11 @@ backport-cc-disable-warning = $(call try-run,\
 	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
 
 NOSTDINC_FLAGS := \
+	-I$(M)/backport-include/ \
 	-I$(M)/include/ \
 	-I$(M)/include/uapi \
 	-I$(M)/include/drm \
-	-include $(M)/include/linux/compat-2.6.h \
+	-include $(M)/backport-include/backport/backport.h \
 	$(call backport-cc-disable-warning, unused-but-set-variable) \
 	-DBACKPORTS_VERSION=\"$(BACKPORTS_VERSION)\" \
 	-DBACKPORTED_KERNEL_VERSION=\"$(BACKPORTED_KERNEL_VERSION)\" \
diff --git a/backport/Makefile.real b/backport/Makefile.real
index 0040ec7..81164da 100644
--- a/backport/Makefile.real
+++ b/backport/Makefile.real
@@ -52,9 +52,9 @@ defconfig-%::
 	echo "\--"							;\
 	false )
 
-include/linux/compat_autoconf.h: .config
+backport-include/backport/autoconf.h: .config
 	@$(MAKE) oldconfig
-	@echo -n "Building include/linux/compat_autoconf.h ..."
+	@echo -n "Building backport-include/backport/autoconf.h ..."
 	@grep -f .local-symbols .config | (				\
 		echo "#ifndef COMPAT_AUTOCONF_INCLUDED"			;\
 		echo "#define COMPAT_AUTOCONF_INCLUDED"			;\
@@ -75,11 +75,11 @@ include/linux/compat_autoconf.h: .config
 			esac						;\
 		done							;\
 		echo "#endif /* COMPAT_AUTOCONF_INCLUDED */"		;\
-	) > include/linux/compat_autoconf.h
+	) > backport-include/backport/autoconf.h
 	@echo " done."
 
 .PHONY: modules
-modules: include/linux/compat_autoconf.h
+modules: backport-include/backport/autoconf.h
 	@$(MAKE) -f Makefile.build modules
 
 .PHONY: install
diff --git a/backport/include/linux/compat-2.6.h b/backport/backport-include/backport/backport.h
similarity index 94%
rename from backport/include/linux/compat-2.6.h
rename to backport/backport-include/backport/backport.h
index f9e0e74..6bbf4a7 100644
--- a/backport/include/linux/compat-2.6.h
+++ b/backport/backport-include/backport/backport.h
@@ -1,10 +1,10 @@
-#ifndef LINUX_26_COMPAT_H
-#define LINUX_26_COMPAT_H
+#ifndef LINUX_BACKPORT_H
+#define LINUX_BACKPORT_H
 
 #ifndef __ASSEMBLY__
 
 #define LINUX_BACKPORT(__sym) backport_ ##__sym
-#include <linux/backport_checks.h>
+#include <backport/checks.h>
 
 #include <linux/version.h>
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
@@ -14,7 +14,7 @@
 #else
 #include <linux/autoconf.h>
 #endif
-#include <linux/compat_autoconf.h>
+#include <backport/autoconf.h>
 #include <linux/init.h>
 #include <linux/uidgid.h>
 #include <linux/module.h>
@@ -88,4 +88,4 @@ void backport_dependency_symbol(void);
 
 #endif /* __ASSEMBLY__ */
 
-#endif /* LINUX_26_COMPAT_H */
+#endif /* LINUX_BACKPORT_H */
diff --git a/backport/include/linux/backport_checks.h b/backport/backport-include/backport/checks.h
similarity index 100%
rename from backport/include/linux/backport_checks.h
rename to backport/backport-include/backport/checks.h
diff --git a/backport/include/crypto/aes.h b/backport/backport-include/crypto/aes.h
similarity index 100%
rename from backport/include/crypto/aes.h
rename to backport/backport-include/crypto/aes.h
diff --git a/backport/include/linux/atomic.h b/backport/backport-include/linux/atomic.h
similarity index 100%
rename from backport/include/linux/atomic.h
rename to backport/backport-include/linux/atomic.h
diff --git a/backport/include/linux/average.h b/backport/backport-include/linux/average.h
similarity index 100%
rename from backport/include/linux/average.h
rename to backport/backport-include/linux/average.h
diff --git a/backport/include/linux/bitops.h b/backport/backport-include/linux/bitops.h
similarity index 100%
rename from backport/include/linux/bitops.h
rename to backport/backport-include/linux/bitops.h
diff --git a/backport/include/linux/compat-2.6.14.h b/backport/backport-include/linux/compat-2.6.14.h
similarity index 100%
rename from backport/include/linux/compat-2.6.14.h
rename to backport/backport-include/linux/compat-2.6.14.h
diff --git a/backport/include/linux/compat-2.6.18.h b/backport/backport-include/linux/compat-2.6.18.h
similarity index 100%
rename from backport/include/linux/compat-2.6.18.h
rename to backport/backport-include/linux/compat-2.6.18.h
diff --git a/backport/include/linux/compat-2.6.19.h b/backport/backport-include/linux/compat-2.6.19.h
similarity index 100%
rename from backport/include/linux/compat-2.6.19.h
rename to backport/backport-include/linux/compat-2.6.19.h
diff --git a/backport/include/linux/compat-2.6.20.h b/backport/backport-include/linux/compat-2.6.20.h
similarity index 100%
rename from backport/include/linux/compat-2.6.20.h
rename to backport/backport-include/linux/compat-2.6.20.h
diff --git a/backport/include/linux/compat-2.6.21.h b/backport/backport-include/linux/compat-2.6.21.h
similarity index 100%
rename from backport/include/linux/compat-2.6.21.h
rename to backport/backport-include/linux/compat-2.6.21.h
diff --git a/backport/include/linux/compat-2.6.22.h b/backport/backport-include/linux/compat-2.6.22.h
similarity index 100%
rename from backport/include/linux/compat-2.6.22.h
rename to backport/backport-include/linux/compat-2.6.22.h
diff --git a/backport/include/linux/compat-2.6.23.h b/backport/backport-include/linux/compat-2.6.23.h
similarity index 100%
rename from backport/include/linux/compat-2.6.23.h
rename to backport/backport-include/linux/compat-2.6.23.h
diff --git a/backport/include/linux/compat-2.6.24.h b/backport/backport-include/linux/compat-2.6.24.h
similarity index 100%
rename from backport/include/linux/compat-2.6.24.h
rename to backport/backport-include/linux/compat-2.6.24.h
diff --git a/backport/include/linux/compat-2.6.25.h b/backport/backport-include/linux/compat-2.6.25.h
similarity index 100%
rename from backport/include/linux/compat-2.6.25.h
rename to backport/backport-include/linux/compat-2.6.25.h
diff --git a/backport/include/linux/compat-2.6.26.h b/backport/backport-include/linux/compat-2.6.26.h
similarity index 100%
rename from backport/include/linux/compat-2.6.26.h
rename to backport/backport-include/linux/compat-2.6.26.h
diff --git a/backport/include/linux/compat-2.6.27.h b/backport/backport-include/linux/compat-2.6.27.h
similarity index 100%
rename from backport/include/linux/compat-2.6.27.h
rename to backport/backport-include/linux/compat-2.6.27.h
diff --git a/backport/include/linux/compat-2.6.28.h b/backport/backport-include/linux/compat-2.6.28.h
similarity index 100%
rename from backport/include/linux/compat-2.6.28.h
rename to backport/backport-include/linux/compat-2.6.28.h
diff --git a/backport/include/linux/compat-2.6.29.h b/backport/backport-include/linux/compat-2.6.29.h
similarity index 100%
rename from backport/include/linux/compat-2.6.29.h
rename to backport/backport-include/linux/compat-2.6.29.h
diff --git a/backport/include/linux/compat-2.6.30.h b/backport/backport-include/linux/compat-2.6.30.h
similarity index 100%
rename from backport/include/linux/compat-2.6.30.h
rename to backport/backport-include/linux/compat-2.6.30.h
diff --git a/backport/include/linux/compat-2.6.31.h b/backport/backport-include/linux/compat-2.6.31.h
similarity index 100%
rename from backport/include/linux/compat-2.6.31.h
rename to backport/backport-include/linux/compat-2.6.31.h
diff --git a/backport/include/linux/compat-2.6.32.h b/backport/backport-include/linux/compat-2.6.32.h
similarity index 100%
rename from backport/include/linux/compat-2.6.32.h
rename to backport/backport-include/linux/compat-2.6.32.h
diff --git a/backport/include/linux/compat-2.6.33.h b/backport/backport-include/linux/compat-2.6.33.h
similarity index 100%
rename from backport/include/linux/compat-2.6.33.h
rename to backport/backport-include/linux/compat-2.6.33.h
diff --git a/backport/include/linux/compat-2.6.34.h b/backport/backport-include/linux/compat-2.6.34.h
similarity index 100%
rename from backport/include/linux/compat-2.6.34.h
rename to backport/backport-include/linux/compat-2.6.34.h
diff --git a/backport/include/linux/compat-2.6.35.h b/backport/backport-include/linux/compat-2.6.35.h
similarity index 100%
rename from backport/include/linux/compat-2.6.35.h
rename to backport/backport-include/linux/compat-2.6.35.h
diff --git a/backport/include/linux/compat-2.6.36.h b/backport/backport-include/linux/compat-2.6.36.h
similarity index 100%
rename from backport/include/linux/compat-2.6.36.h
rename to backport/backport-include/linux/compat-2.6.36.h
diff --git a/backport/include/linux/compat-2.6.37.h b/backport/backport-include/linux/compat-2.6.37.h
similarity index 100%
rename from backport/include/linux/compat-2.6.37.h
rename to backport/backport-include/linux/compat-2.6.37.h
diff --git a/backport/include/linux/compat-2.6.38.h b/backport/backport-include/linux/compat-2.6.38.h
similarity index 100%
rename from backport/include/linux/compat-2.6.38.h
rename to backport/backport-include/linux/compat-2.6.38.h
diff --git a/backport/include/linux/compat-2.6.39.h b/backport/backport-include/linux/compat-2.6.39.h
similarity index 100%
rename from backport/include/linux/compat-2.6.39.h
rename to backport/backport-include/linux/compat-2.6.39.h
diff --git a/backport/include/linux/compat-3.0.h b/backport/backport-include/linux/compat-3.0.h
similarity index 100%
rename from backport/include/linux/compat-3.0.h
rename to backport/backport-include/linux/compat-3.0.h
diff --git a/backport/include/linux/compat-3.1.h b/backport/backport-include/linux/compat-3.1.h
similarity index 100%
rename from backport/include/linux/compat-3.1.h
rename to backport/backport-include/linux/compat-3.1.h
diff --git a/backport/include/linux/compat-3.10.h b/backport/backport-include/linux/compat-3.10.h
similarity index 100%
rename from backport/include/linux/compat-3.10.h
rename to backport/backport-include/linux/compat-3.10.h
diff --git a/backport/include/linux/compat-3.2.h b/backport/backport-include/linux/compat-3.2.h
similarity index 100%
rename from backport/include/linux/compat-3.2.h
rename to backport/backport-include/linux/compat-3.2.h
diff --git a/backport/include/linux/compat-3.3.h b/backport/backport-include/linux/compat-3.3.h
similarity index 100%
rename from backport/include/linux/compat-3.3.h
rename to backport/backport-include/linux/compat-3.3.h
diff --git a/backport/include/linux/compat-3.4.h b/backport/backport-include/linux/compat-3.4.h
similarity index 100%
rename from backport/include/linux/compat-3.4.h
rename to backport/backport-include/linux/compat-3.4.h
diff --git a/backport/include/linux/compat-3.5.h b/backport/backport-include/linux/compat-3.5.h
similarity index 100%
rename from backport/include/linux/compat-3.5.h
rename to backport/backport-include/linux/compat-3.5.h
diff --git a/backport/include/linux/compat-3.6.h b/backport/backport-include/linux/compat-3.6.h
similarity index 100%
rename from backport/include/linux/compat-3.6.h
rename to backport/backport-include/linux/compat-3.6.h
diff --git a/backport/include/linux/compat-3.7.h b/backport/backport-include/linux/compat-3.7.h
similarity index 100%
rename from backport/include/linux/compat-3.7.h
rename to backport/backport-include/linux/compat-3.7.h
diff --git a/backport/include/linux/compat-3.8.h b/backport/backport-include/linux/compat-3.8.h
similarity index 100%
rename from backport/include/linux/compat-3.8.h
rename to backport/backport-include/linux/compat-3.8.h
diff --git a/backport/include/linux/compat-3.9.h b/backport/backport-include/linux/compat-3.9.h
similarity index 100%
rename from backport/include/linux/compat-3.9.h
rename to backport/backport-include/linux/compat-3.9.h
diff --git a/backport/include/linux/cordic.h b/backport/backport-include/linux/cordic.h
similarity index 100%
rename from backport/include/linux/cordic.h
rename to backport/backport-include/linux/cordic.h
diff --git a/backport/include/linux/crc8.h b/backport/backport-include/linux/crc8.h
similarity index 100%
rename from backport/include/linux/crc8.h
rename to backport/backport-include/linux/crc8.h
diff --git a/backport/include/linux/export.h b/backport/backport-include/linux/export.h
similarity index 100%
rename from backport/include/linux/export.h
rename to backport/backport-include/linux/export.h
diff --git a/backport/include/linux/gpio.h b/backport/backport-include/linux/gpio.h
similarity index 100%
rename from backport/include/linux/gpio.h
rename to backport/backport-include/linux/gpio.h
diff --git a/backport/include/linux/kfifo.h b/backport/backport-include/linux/kfifo.h
similarity index 100%
rename from backport/include/linux/kfifo.h
rename to backport/backport-include/linux/kfifo.h
diff --git a/backport/include/linux/kmemleak.h b/backport/backport-include/linux/kmemleak.h
similarity index 100%
rename from backport/include/linux/kmemleak.h
rename to backport/backport-include/linux/kmemleak.h
diff --git a/backport/include/linux/math64.h b/backport/backport-include/linux/math64.h
similarity index 100%
rename from backport/include/linux/math64.h
rename to backport/backport-include/linux/math64.h
diff --git a/backport/include/linux/of.h b/backport/backport-include/linux/of.h
similarity index 100%
rename from backport/include/linux/of.h
rename to backport/backport-include/linux/of.h
diff --git a/backport/include/linux/olpc-ec.h b/backport/backport-include/linux/olpc-ec.h
similarity index 100%
rename from backport/include/linux/olpc-ec.h
rename to backport/backport-include/linux/olpc-ec.h
diff --git a/backport/include/linux/pci-aspm.h b/backport/backport-include/linux/pci-aspm.h
similarity index 100%
rename from backport/include/linux/pci-aspm.h
rename to backport/backport-include/linux/pci-aspm.h
diff --git a/backport/include/linux/pm_qos.h b/backport/backport-include/linux/pm_qos.h
similarity index 100%
rename from backport/include/linux/pm_qos.h
rename to backport/backport-include/linux/pm_qos.h
diff --git a/backport/include/linux/pm_qos_params.h b/backport/backport-include/linux/pm_qos_params.h
similarity index 100%
rename from backport/include/linux/pm_qos_params.h
rename to backport/backport-include/linux/pm_qos_params.h
diff --git a/backport/include/linux/pm_runtime.h b/backport/backport-include/linux/pm_runtime.h
similarity index 100%
rename from backport/include/linux/pm_runtime.h
rename to backport/backport-include/linux/pm_runtime.h
diff --git a/backport/include/linux/printk.h b/backport/backport-include/linux/printk.h
similarity index 100%
rename from backport/include/linux/printk.h
rename to backport/backport-include/linux/printk.h
diff --git a/backport/include/linux/rfkill.h b/backport/backport-include/linux/rfkill.h
similarity index 100%
rename from backport/include/linux/rfkill.h
rename to backport/backport-include/linux/rfkill.h
diff --git a/backport/include/linux/semaphore.h b/backport/backport-include/linux/semaphore.h
similarity index 100%
rename from backport/include/linux/semaphore.h
rename to backport/backport-include/linux/semaphore.h
diff --git a/backport/include/linux/tracepoint.h b/backport/backport-include/linux/tracepoint.h
similarity index 100%
rename from backport/include/linux/tracepoint.h
rename to backport/backport-include/linux/tracepoint.h
diff --git a/backport/include/linux/u64_stats_sync.h b/backport/backport-include/linux/u64_stats_sync.h
similarity index 100%
rename from backport/include/linux/u64_stats_sync.h
rename to backport/backport-include/linux/u64_stats_sync.h
diff --git a/backport/include/linux/uidgid.h b/backport/backport-include/linux/uidgid.h
similarity index 100%
rename from backport/include/linux/uidgid.h
rename to backport/backport-include/linux/uidgid.h
diff --git a/backport/include/linux/unaligned/access_ok.h b/backport/backport-include/linux/unaligned/access_ok.h
similarity index 100%
rename from backport/include/linux/unaligned/access_ok.h
rename to backport/backport-include/linux/unaligned/access_ok.h
diff --git a/backport/include/linux/unaligned/be_byteshift.h b/backport/backport-include/linux/unaligned/be_byteshift.h
similarity index 100%
rename from backport/include/linux/unaligned/be_byteshift.h
rename to backport/backport-include/linux/unaligned/be_byteshift.h
diff --git a/backport/include/linux/unaligned/be_memmove.h b/backport/backport-include/linux/unaligned/be_memmove.h
similarity index 100%
rename from backport/include/linux/unaligned/be_memmove.h
rename to backport/backport-include/linux/unaligned/be_memmove.h
diff --git a/backport/include/linux/unaligned/be_struct.h b/backport/backport-include/linux/unaligned/be_struct.h
similarity index 100%
rename from backport/include/linux/unaligned/be_struct.h
rename to backport/backport-include/linux/unaligned/be_struct.h
diff --git a/backport/include/linux/unaligned/generic.h b/backport/backport-include/linux/unaligned/generic.h
similarity index 100%
rename from backport/include/linux/unaligned/generic.h
rename to backport/backport-include/linux/unaligned/generic.h
diff --git a/backport/include/linux/unaligned/le_byteshift.h b/backport/backport-include/linux/unaligned/le_byteshift.h
similarity index 100%
rename from backport/include/linux/unaligned/le_byteshift.h
rename to backport/backport-include/linux/unaligned/le_byteshift.h
diff --git a/backport/include/linux/unaligned/le_memmove.h b/backport/backport-include/linux/unaligned/le_memmove.h
similarity index 100%
rename from backport/include/linux/unaligned/le_memmove.h
rename to backport/backport-include/linux/unaligned/le_memmove.h
diff --git a/backport/include/linux/unaligned/le_struct.h b/backport/backport-include/linux/unaligned/le_struct.h
similarity index 100%
rename from backport/include/linux/unaligned/le_struct.h
rename to backport/backport-include/linux/unaligned/le_struct.h
diff --git a/backport/include/linux/unaligned/memmove.h b/backport/backport-include/linux/unaligned/memmove.h
similarity index 100%
rename from backport/include/linux/unaligned/memmove.h
rename to backport/backport-include/linux/unaligned/memmove.h
diff --git a/backport/include/linux/unaligned/packed_struct.h b/backport/backport-include/linux/unaligned/packed_struct.h
similarity index 100%
rename from backport/include/linux/unaligned/packed_struct.h
rename to backport/backport-include/linux/unaligned/packed_struct.h
diff --git a/backport/include/linux/vga_switcheroo.h b/backport/backport-include/linux/vga_switcheroo.h
similarity index 100%
rename from backport/include/linux/vga_switcheroo.h
rename to backport/backport-include/linux/vga_switcheroo.h
diff --git a/backport/include/linux/wireless.h b/backport/backport-include/linux/wireless.h
similarity index 100%
rename from backport/include/linux/wireless.h
rename to backport/backport-include/linux/wireless.h
diff --git a/backport/include/net/codel.h b/backport/backport-include/net/codel.h
similarity index 100%
rename from backport/include/net/codel.h
rename to backport/backport-include/net/codel.h
diff --git a/backport/include/net/flow_keys.h b/backport/backport-include/net/flow_keys.h
similarity index 100%
rename from backport/include/net/flow_keys.h
rename to backport/backport-include/net/flow_keys.h
diff --git a/backport/include/net/net_namespace.h b/backport/backport-include/net/net_namespace.h
similarity index 100%
rename from backport/include/net/net_namespace.h
rename to backport/backport-include/net/net_namespace.h
diff --git a/backport/include/pcmcia/cistpl.h b/backport/backport-include/pcmcia/cistpl.h
similarity index 100%
rename from backport/include/pcmcia/cistpl.h
rename to backport/backport-include/pcmcia/cistpl.h
diff --git a/backport/include/trace/define_trace.h b/backport/backport-include/trace/define_trace.h
similarity index 100%
rename from backport/include/trace/define_trace.h
rename to backport/backport-include/trace/define_trace.h
diff --git a/devel/doc/makefile-operation b/devel/doc/makefile-operation
index 6a96ded..38cf4e7 100644
--- a/devel/doc/makefile-operation
+++ b/devel/doc/makefile-operation
@@ -23,7 +23,7 @@ Once these are in place, the configuration process can start with any of
 the tools -- menuconfig, defconfig-*, ...
 
 When the configuration is complete and exists in .config, the autoconf
-header (include/linux/compat_autoconf.h) must be generated. This step is
+header (backport-include/backport/autoconf.h) must be generated. This step is
 also done in the make system (by a small embedded shell script) and needs
 the .local-symbols so it only includes the symbols from the backport.
 
diff --git a/gentree.py b/gentree.py
index 204fffd..3ba73ea 100755
--- a/gentree.py
+++ b/gentree.py
@@ -323,7 +323,7 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
     # do the copy
     backport_files = [(x, x) for x in [
         'Kconfig', 'Makefile', 'Makefile.build', 'Makefile.kernel', '.gitignore',
-        'Makefile.real', 'compat/', 'include/', 'kconfig/', 'defconfigs/',
+        'Makefile.real', 'compat/', 'backport-include/', 'kconfig/', 'defconfigs/',
         'scripts/', '.blacklist.map', 'udev/',
     ]]
     if not args.git_revision:
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 05/42] backports: fix dma-buf backport patch
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (3 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 04/42] backports: move header files Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 06/42] backports: remove support for < 2.6.24 Johannes Berg
                   ` (39 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

The patched backported dma-buf code uses the "current" macro
to determine task information, so it needs to include sched.h.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 patches/backport-adjustments/dma-buf.patch | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/patches/backport-adjustments/dma-buf.patch b/patches/backport-adjustments/dma-buf.patch
index 06ed9f6..789a108 100644
--- a/patches/backport-adjustments/dma-buf.patch
+++ b/patches/backport-adjustments/dma-buf.patch
@@ -1,12 +1,13 @@
 --- a/compat/drivers-base-dma-buf.c
 +++ b/compat/drivers-base-dma-buf.c
-@@ -27,6 +27,9 @@
+@@ -27,6 +27,10 @@
  #include <linux/dma-buf.h>
  #include <linux/anon_inodes.h>
  #include <linux/export.h>
 +#include <linux/file.h>
 +#include <linux/fdtable.h>
 +#include <linux/bitops.h>
++#include <linux/sched.h>
  
  static inline int is_dma_buf_file(struct file *);
  
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 06/42] backports: remove support for < 2.6.24
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (4 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 05/42] backports: fix dma-buf backport patch Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 07/42] backports: remove __inet_lookup_established Johannes Berg
                   ` (38 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This hasn't been tested in years, and those kernels
aren't getting more interesting, so just remove the
support for them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/backport/backport.h   |   3 -
 backport/backport-include/linux/compat-2.6.14.h |  13 --
 backport/backport-include/linux/compat-2.6.18.h |  13 --
 backport/backport-include/linux/compat-2.6.19.h |  24 ---
 backport/backport-include/linux/compat-2.6.20.h |  21 --
 backport/backport-include/linux/compat-2.6.21.h |  18 --
 backport/backport-include/linux/compat-2.6.22.h | 104 ----------
 backport/backport-include/linux/compat-2.6.23.h | 139 -------------
 backport/backport-include/linux/compat-2.6.24.h | 252 ------------------------
 backport/compat/Makefile                        |   7 -
 backport/compat/compat-2.6.14.c                 |  14 --
 backport/compat/compat-2.6.18.c                 |  14 --
 backport/compat/compat-2.6.19.c                 |  14 --
 backport/compat/compat-2.6.21.c                 |  14 --
 backport/compat/compat-2.6.22.c                 |  14 --
 backport/compat/compat-2.6.23.c                 | 241 ----------------------
 backport/compat/compat-2.6.24.c                 | 158 ---------------
 17 files changed, 1063 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.14.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.18.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.19.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.20.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.21.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.22.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.23.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.24.h
 delete mode 100644 backport/compat/compat-2.6.14.c
 delete mode 100644 backport/compat/compat-2.6.18.c
 delete mode 100644 backport/compat/compat-2.6.19.c
 delete mode 100644 backport/compat/compat-2.6.21.c
 delete mode 100644 backport/compat/compat-2.6.22.c
 delete mode 100644 backport/compat/compat-2.6.23.c
 delete mode 100644 backport/compat/compat-2.6.24.c

diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index 6bbf4a7..97e5316 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -56,9 +56,6 @@ void backport_dependency_symbol(void);
  * code introduced for *that* kernel revision.
  */
 
-#include <linux/compat-2.6.22.h>
-#include <linux/compat-2.6.23.h>
-#include <linux/compat-2.6.24.h>
 #include <linux/compat-2.6.25.h>
 #include <linux/compat-2.6.26.h>
 #include <linux/compat-2.6.27.h>
diff --git a/backport/backport-include/linux/compat-2.6.14.h b/backport/backport-include/linux/compat-2.6.14.h
deleted file mode 100644
index 1f19f7f..0000000
--- a/backport/backport-include/linux/compat-2.6.14.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef LINUX_26_14_COMPAT_H
-#define LINUX_26_14_COMPAT_H
-
-#include <linux/version.h>
-
-/* Compat work for 2.6.14 */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
-
-typedef unsigned int gfp_t;
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)) */
-
-#endif /* LINUX_26_14_COMPAT_H */
diff --git a/backport/backport-include/linux/compat-2.6.18.h b/backport/backport-include/linux/compat-2.6.18.h
deleted file mode 100644
index 5e0182b..0000000
--- a/backport/backport-include/linux/compat-2.6.18.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef LINUX_26_18_COMPAT_H
-#define LINUX_26_18_COMPAT_H
-
-#include <linux/version.h>
-
-/* Compat work for 2.6.18 */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18))
-
-#define roundup(x, y)	((((x) + ((y) - 1)) / (y)) * (y))
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) */
-
-#endif /* LINUX_26_18_COMPAT_H */
diff --git a/backport/backport-include/linux/compat-2.6.19.h b/backport/backport-include/linux/compat-2.6.19.h
deleted file mode 100644
index 1e648c0..0000000
--- a/backport/backport-include/linux/compat-2.6.19.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef LINUX_26_19_COMPAT_H
-#define LINUX_26_19_COMPAT_H
-
-#include <linux/version.h>
-
-/* Compat work for 2.6.19 */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-
-#include <linux/slab.h>
-
-static inline int
-compat_kmem_cache_destroy(struct kmem_cache *cachep)
-{
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
-	return kmem_cache_destroy(cachep);
-#else
-	kmem_cache_destroy(cachep);
-	return 0;
-#endif
-}
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) */
-
-#endif /* LINUX_26_19_COMPAT_H */
diff --git a/backport/backport-include/linux/compat-2.6.20.h b/backport/backport-include/linux/compat-2.6.20.h
deleted file mode 100644
index 14579e2..0000000
--- a/backport/backport-include/linux/compat-2.6.20.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef LINUX_26_20_COMPAT_H
-#define LINUX_26_20_COMPAT_H
-
-#include <linux/version.h>
-
-/* Compat work for 2.6.20 */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
-
-#include <linux/workqueue.h>
-
-typedef void (*work_func_t)(struct work_struct *work);
-typedef void (*compat_work_func_t)(void *work);
-static inline void (INIT_WORK)(struct work_struct *work, work_func_t func)
-{
-	INIT_WORK(work, (compat_work_func_t)func, work);
-}
-#undef INIT_WORK
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) */
-
-#endif /* LINUX_26_20_COMPAT_H */
diff --git a/backport/backport-include/linux/compat-2.6.21.h b/backport/backport-include/linux/compat-2.6.21.h
deleted file mode 100644
index 89ed6d9..0000000
--- a/backport/backport-include/linux/compat-2.6.21.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef LINUX_26_21_COMPAT_H
-#define LINUX_26_21_COMPAT_H
-
-#include <linux/version.h>
-
-/* Compat work for 2.6.21 */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
-
-#include <linux/sysctl.h>
-
-#define register_sysctl_table(table)				\
-	({							\
-		register_sysctl_table((table), 0);		\
-	})
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) */
-
-#endif /* LINUX_26_21_COMPAT_H */
diff --git a/backport/backport-include/linux/compat-2.6.22.h b/backport/backport-include/linux/compat-2.6.22.h
deleted file mode 100644
index 7ca1b18..0000000
--- a/backport/backport-include/linux/compat-2.6.22.h
+++ /dev/null
@@ -1,104 +0,0 @@
-#ifndef LINUX_26_22_COMPAT_H
-#define LINUX_26_22_COMPAT_H
-
-#include <linux/version.h>
-
-/* Compat work for 2.6.21 */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22))
-
-#include <linux/pci.h>
-#include <linux/skbuff.h>
-
-/* reuse ax25_ptr */
-#define ieee80211_ptr ax25_ptr
-
-#ifdef CONFIG_AX25
-#error Compat reuses the AX.25 pointer so that may not be enabled!
-#endif
-
-static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
-{
-	return skb->mac.raw;
-}
-
-static inline void skb_set_mac_header(struct sk_buff *skb, int offset)
-{
-	skb->mac.raw = skb->data + offset;
-}
-
-static inline void skb_reset_mac_header(struct sk_buff *skb)
-{
-	skb->mac.raw = skb->data;
-}
-
-static inline void skb_reset_network_header(struct sk_buff *skb)
-{
-	skb->nh.raw = skb->data;
-}
-
-static inline void skb_set_network_header(struct sk_buff *skb, int offset)
-{
-	skb->nh.raw = skb->data + offset;
-}
-
-static inline void skb_set_transport_header(struct sk_buff *skb, int offset)
-{
-	skb->h.raw = skb->data + offset;
-}
-
-static inline unsigned char *skb_transport_header(struct sk_buff *skb)
-{
-	return skb->h.raw;
-}
-
-static inline unsigned char *skb_network_header(const struct sk_buff *skb)
-{
-	return skb->nh.raw;
-}
-
-static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb)
-{
-	return skb->tail;
-}
-
-static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
-{
-	return (struct iphdr *)skb_network_header(skb);
-}
-
-static inline void skb_copy_from_linear_data(const struct sk_buff *skb,
-					     void *to,
-					     const unsigned int len)
-{
-	memcpy(to, skb->data, len);
-}
-
-static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb,
-						    const int offset, void *to,
-						    const unsigned int len)
-{
-	memcpy(to, skb->data + offset, len);
-}
-
-#define __maybe_unused	__attribute__((unused))
-
-#define uninitialized_var(x) x = x
-
-/* This will lead to very weird behaviour... */
-#define NLA_BINARY NLA_STRING
-
-static inline int pci_set_mwi(struct pci_dev *dev)
-{
-	return -ENOSYS;
-}
-
-static inline void pci_clear_mwi(struct pci_dev *dev)
-{
-}
-
-#define list_first_entry(ptr, type, member) \
-        list_entry((ptr)->next, type, member)
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)) */
-
-#endif /* LINUX_26_22_COMPAT_H */
diff --git a/backport/backport-include/linux/compat-2.6.23.h b/backport/backport-include/linux/compat-2.6.23.h
deleted file mode 100644
index 37cbc22..0000000
--- a/backport/backport-include/linux/compat-2.6.23.h
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef LINUX_26_23_COMPAT_H
-#define LINUX_26_23_COMPAT_H
-
-#include <linux/version.h>
-
-/* Compat work for < 2.6.23 */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
-
-#include <linux/netdevice.h>
-#include <linux/sched.h>
-#include <linux/workqueue.h>
-#include <linux/genetlink.h>
-#include <net/sch_generic.h>
-
-/*
- * Tell gcc if a function is cold. The compiler will assume any path
- * directly leading to the call is unlikely.
- */
-
-#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3)
-/* Mark functions as cold. gcc will assume any path leading to a call
- * to them will be unlikely.  This means a lot of manual unlikely()s
- * are unnecessary now for any paths leading to the usual suspects
- * like BUG(), printk(), panic() etc. [but let's keep them for now for
- * older compilers]
- *
- * Early snapshots of gcc 4.3 don't support this and we can't detect this
- * in the preprocessor, but we can live with this because they're unreleased.
- * Maketime probing would be overkill here.
- *
- * gcc also has a __attribute__((__hot__)) to move hot functions into
- * a special section, but I don't see any sense in this right now in
- * the kernel context */
-#define __cold                  __attribute__((__cold__))
-#endif /* gcc 4.3 check */
-
-#ifndef __cold
-#define __cold
-#endif
-
-/* Added as of 2.6.23 in include/linux/netdevice.h */
-#define alloc_netdev_mq(sizeof_priv, name, setup, queue) \
-	alloc_netdev(sizeof_priv, name, setup)
-#define NETIF_F_MULTI_QUEUE 16384
-
-/* Added as of 2.6.23 on include/linux/netdevice.h */
-static inline int netif_is_multiqueue(const struct net_device *dev)
-{
-	return (!!(NETIF_F_MULTI_QUEUE & dev->features));
-}
-
-/* 2.6.23 fixed a bug in tcf_destroy_chain and the parameter changed */
-static inline void tcf_destroy_chain_compat(struct tcf_proto **fl)
-{
-	struct tcf_proto *tp;
-
-	while ((tp = *fl) != NULL) {
-		*fl = tp->next;
-		tp->ops->destroy(tp);
-		module_put(tp->ops->owner);
-		kfree(tp);
-	}
-}
-
-/* dev_mc_list was replaced with dev_addr_list as of 2.6.23,
- * only new member added is da_synced. */
-#define dev_addr_list	dev_mc_list
-#define da_addr		dmi_addr
-#define da_addrlen	dmi_addrlen
-#define da_users	dmi_users
-#define da_gusers	dmi_gusers
-
-/* dev_set_promiscuity() was moved to __dev_set_promiscuity() on 2.6.23 and
- * dev_set_promiscuity() became a wrapper. */
-#define __dev_set_promiscuity dev_set_promiscuity
-
-/* Our own 2.6.22 port on compat.c */
-#define dev_mc_unsync LINUX_BACKPORT(dev_mc_unsync)
-#define dev_mc_sync LINUX_BACKPORT(dev_mc_sync)
-extern void	dev_mc_unsync(struct net_device *to, struct net_device *from);
-extern int	dev_mc_sync(struct net_device *to, struct net_device *from);
-
-/* Our own 2.6.22 port on compat.c */
-extern void	__dev_set_rx_mode(struct net_device *dev);
-
-/* Simple to add this */
-extern int cancel_delayed_work_sync(struct delayed_work *work);
-
-#define cancel_delayed_work_sync cancel_rearming_delayed_work
-
-#define debugfs_rename(a, b, c, d) 1
-
-/* nl80211 requires multicast group support which is new and added on
- * 2.6.23. We can't add support for it for older kernels to support it
- * genl_family structure was changed. Lets just let through the
- * genl_register_mc_group call. This means no multicast group suppport */
-
-#define genl_register_mc_group(a, b) 0
-
-/**
- * struct genl_multicast_group - generic netlink multicast group
- * @name: name of the multicast group, names are per-family
- * @id: multicast group ID, assigned by the core, to use with
- * 	genlmsg_multicast().
- * @list: list entry for linking
- * @family: pointer to family, need not be set before registering
- */
-struct genl_multicast_group
-{
-	struct genl_family      *family;        /* private */
-	struct list_head        list;           /* private */
-	char                    name[GENL_NAMSIZ];
-	u32                     id;
-};
-
-
-/* Added as of 2.6.23 */
-#define pci_try_set_mwi LINUX_BACKPORT(pci_try_set_mwi)
-int pci_try_set_mwi(struct pci_dev *dev);
-
-/* Added as of 2.6.23 */
-#ifdef CONFIG_PM_SLEEP
-/*
- * Tell the freezer that the current task should be frozen by it
- */
-static inline void set_freezable(void)
-{
-	current->flags &= ~PF_NOFREEZE;
-}
-
-#else
-static inline void set_freezable(void) {}
-#endif /* CONFIG_PM_SLEEP */
-
-#else
-#define tcf_destroy_chain_compat tcf_destroy_chain
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) */
-
-#endif /* LINUX_26_23_COMPAT_H */
diff --git a/backport/backport-include/linux/compat-2.6.24.h b/backport/backport-include/linux/compat-2.6.24.h
deleted file mode 100644
index 5448604..0000000
--- a/backport/backport-include/linux/compat-2.6.24.h
+++ /dev/null
@@ -1,252 +0,0 @@
-#ifndef LINUX_26_24_COMPAT_H
-#define LINUX_26_24_COMPAT_H
-
-#include <linux/version.h>
-
-/* Compat work for 2.6.21, 2.6.22 and 2.6.23 */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
-
-#include <asm/atomic.h>
-#include <linux/netdevice.h>
-#include <linux/skbuff.h>
-#include <linux/usb.h>
-#include <linux/types.h>
-#include <linux/list.h>
-#include <linux/scatterlist.h>
-
-#define KEY_BLUETOOTH	237
-#define KEY_WLAN	238
-#define KEY_UWB		239
-
-#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
-
-struct proc_dir_entry;
-struct net_device;
-struct net {
-	atomic_t		count;		/* To decided when the network
-						 *  namespace should be freed.
-						 */
-	atomic_t		use_count;	/* To track references we
-						 * destroy on demand
-						 */
-	struct list_head	list;		/* list of network namespaces */
-	struct work_struct	work;		/* work struct for freeing */
-
-	struct proc_dir_entry 	*proc_net;
-	struct proc_dir_entry 	*proc_net_stat;
-	struct proc_dir_entry 	*proc_net_root;
-
-	struct net_device       *loopback_dev;          /* The loopback */
-
-	struct list_head 	dev_base_head;
-	struct hlist_head 	*dev_name_head;
-	struct hlist_head	*dev_index_head;
-};
-
-#ifdef CONFIG_NET
-/* Init's network namespace */
-#define init_net LINUX_BACKPORT(init_net)
-extern struct net init_net;
-#define INIT_NET_NS(net_ns) .net_ns = &init_net,
-#else
-#define INIT_NET_NS(net_ns)
-#endif
-
-/* Added on 2.6.24 in include/linux/types.h by Al viro on commit 142956af */
-typedef unsigned long               uintptr_t;
-
-/* From include/linux/net.h */
-enum sock_shutdown_cmd {
-	SHUT_RD		= 0,
-	SHUT_WR		= 1,
-	SHUT_RDWR	= 2,
-};
-
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,23)) /* Local check */
-/* Added as of 2.6.24 in include/linux/skbuff.h.
- *
- * Although 2.6.23 does support for CONFIG_NETDEVICES_MULTIQUEUE
- * this helper was not added until 2.6.24. This implementation
- * is exactly as it is on newer kernels.
- *
- * For older kernels we use the an internal mac80211 hack.
- * For details see changes to include/net/mac80211.h through
- * compat.diff and compat/mq_compat.h */
-static inline u16 skb_get_queue_mapping(struct sk_buff *skb)
-{
-#ifdef CONFIG_NETDEVICES_MULTIQUEUE
-	return skb->queue_mapping;
-#else
-	return 0;
-#endif
-}
-#endif /* Local 2.6.23 check */
-
-/* On older kernels we handle this a bit differently, so we yield to that
- * code for its implementation in mq_compat.h as we want to make
- * use of the internal mac80211 __ieee80211_queue_stopped() which itself
- * uses internal mac80211 data structure hacks. */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)) /* Local check */
-/**
- * netif_subqueue_stopped - test status of subqueue
- * @dev: network device
- * @queue_index: sub queue index
- *
- * Check individual transmit queue of a device with multiple transmit queues.
- */
-static inline int __netif_subqueue_stopped(const struct net_device *dev,
-					u16 queue_index)
-{
-#ifdef CONFIG_NETDEVICES_MULTIQUEUE
-	return test_bit(__LINK_STATE_XOFF,
-	&dev->egress_subqueue[queue_index].state);
-#else
-	return 0;
-#endif
-}
-
-/* Note: although the backport implementation for netif_subqueue_stopped
- * on older kernels is identical to upstream __netif_subqueue_stopped()
- * (except for a const qualifier) we implement netif_subqueue_stopped()
- * as part of mac80211 as it relies on internal mac80211 structures we
- * use for MQ support. We this implement it in mq_compat.h */
-
-#endif /* Local 2.6.23 check */
-
-/*
- * Force link bug if constructor is used, can't be done compatibly
- * because constructor arguments were swapped since then!
- */
-extern void __incompatible_kmem_cache_create(void);
-
-/* 2.6.21 and 2.6.22 kmem_cache_create() takes 6 arguments */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
-#define kmem_cache_create(name, objsize, align, flags, ctor) 	\
-	({							\
-		if (ctor) __incompatible_kmem_cache_create();	\
-		kmem_cache_create((name), (objsize), (align),	\
-				  (flags), NULL, NULL);		\
-	})
-#endif
-
-/* 2.6.23 kmem_cache_create() takes 5 arguments */
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,23))
-#define kmem_cache_create(name, objsize, align, flags, ctor) 	\
-	({							\
-		if (ctor) __incompatible_kmem_cache_create();	\
-		kmem_cache_create((name), (objsize), (align),	\
-				  (flags), NULL);		\
-	})
-#endif
-
-/* From include/linux/mod_devicetable.h */
-
-/* SSB core, see drivers/ssb/ */
-#ifndef SSB_DEVICE
-struct ssb_device_id {
-	__u16   vendor;
-	__u16   coreid;
-	__u8    revision;
-};
-#define SSB_DEVICE(_vendor, _coreid, _revision)  \
-	{ .vendor = _vendor, .coreid = _coreid, .revision = _revision, }
-#define SSB_DEVTABLE_END  \
-	{ 0, },
-
-#define SSB_ANY_VENDOR          0xFFFF
-#define SSB_ANY_ID              0xFFFF
-#define SSB_ANY_REV             0xFF
-#endif
-
-
-/* Namespace stuff, introduced on 2.6.24 */
-#define dev_get_by_index(a, b)		dev_get_by_index(b)
-#define __dev_get_by_index(a, b)	__dev_get_by_index(b)
-
-#define eth_header LINUX_BACKPORT(eth_header)
-extern int		eth_header(struct sk_buff *skb, struct net_device *dev,
-				unsigned short type, void *daddr,
-				void *saddr, unsigned len);
-#define eth_rebuild_header LINUX_BACKPORT(eth_rebuild_header)
-extern int		eth_rebuild_header(struct sk_buff *skb);
-#define eth_header_cache_update LINUX_BACKPORT(eth_header_cache_update)
-extern void		eth_header_cache_update(struct hh_cache *hh, struct net_device *dev,
-				unsigned char * haddr);
-#define eth_header_cache LINUX_BACKPORT(eth_header_cache)
-extern int		eth_header_cache(struct neighbour *neigh,
-			struct hh_cache *hh);
-
-/* This structure is simply not present on 2.6.22 and 2.6.23 */
-struct header_ops {
-	int     (*create) (struct sk_buff *skb, struct net_device *dev,
-		unsigned short type, void *daddr,
-		void *saddr, unsigned len);
-	int     (*parse)(const struct sk_buff *skb, unsigned char *haddr);
-	int     (*rebuild)(struct sk_buff *skb);
-	#define HAVE_HEADER_CACHE
-	int     (*cache)(struct neighbour *neigh, struct hh_cache *hh);
-	void    (*cache_update)(struct hh_cache *hh,
-		struct net_device *dev,
-		unsigned char *haddr);
-};
-
-/* net/ieee80211/ieee80211_crypt_tkip uses sg_init_table. This was added on
- * 2.6.24. CONFIG_DEBUG_SG was added in 2.6.24 as well, so lets just ignore
- * the debug stuff. Note that adding this required changes to the struct
- * scatterlist on include/asm/scatterlist*, so the right way to port this
- * is to simply ignore the new structure changes and zero the scatterlist
- * array. We lave the kdoc intact for reference.
- */
-
-/**
- * sg_mark_end - Mark the end of the scatterlist
- * @sg:          SG entryScatterlist
- *
- * Description:
- *   Marks the passed in sg entry as the termination point for the sg
- *   table. A call to sg_next() on this entry will return NULL.
- *
- **/
-static inline void sg_mark_end(struct scatterlist *sg)
-{
-#ifdef CONFIG_DEBUG_SG
-	BUG_ON(sg->sg_magic != SG_MAGIC);
-#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
-	/*
-	 * Set termination bit, clear potential chain bit
-	*/
-	sg->page_link |= 0x02;
-	sg->page_link &= ~0x01;
-#endif
-}
-
-/**
- * sg_init_table - Initialize SG table
- * @sgl:           The SG table
- * @nents:         Number of entries in table
- *
- * Notes:
- *   If this is part of a chained sg table, sg_mark_end() should be
- *   used only on the last table part.
- *
- **/
-static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
-{
-	memset(sgl, 0, sizeof(*sgl) * nents);
-}
-
-/**
- * usb_endpoint_num - get the endpoint's number
- * @epd: endpoint to be checked
- *
- * Returns @epd's number: 0 to 15.
- */
-static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
-{
-	return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
-}
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) */
-
-#endif /* LINUX_26_24_COMPAT_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 499d4c0..8c62cbb 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -13,13 +13,6 @@ obj-$(CPTCFG_BACKPORT_BUILD_CORDIC) += cordic.o
 obj-$(CPTCFG_BACKPORT_BUILD_CRC8) += crc8.o
 
 # Compat kernel compatibility code
-compat-$(CPTCFG_BACKPORT_KERNEL_2_6_14) += compat-2.6.14.o
-compat-$(CPTCFG_BACKPORT_KERNEL_2_6_18) += compat-2.6.18.o
-compat-$(CPTCFG_BACKPORT_KERNEL_2_6_19) += compat-2.6.19.o
-compat-$(CPTCFG_BACKPORT_KERNEL_2_6_21) += compat-2.6.21.o
-compat-$(CPTCFG_BACKPORT_KERNEL_2_6_22) += compat-2.6.22.o
-compat-$(CPTCFG_BACKPORT_KERNEL_2_6_23) += compat-2.6.23.o
-compat-$(CPTCFG_BACKPORT_KERNEL_2_6_24) += compat-2.6.24.o
 compat-$(CPTCFG_BACKPORT_KERNEL_2_6_25) += compat-2.6.25.o pm_qos_params.o
 compat-$(CPTCFG_BACKPORT_KERNEL_2_6_26) += compat-2.6.26.o
 compat-$(CPTCFG_BACKPORT_KERNEL_2_6_27) += compat-2.6.27.o
diff --git a/backport/compat/compat-2.6.14.c b/backport/compat/compat-2.6.14.c
deleted file mode 100644
index 3de847d..0000000
--- a/backport/compat/compat-2.6.14.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2007	Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 2.6.14.
- */
-
-#include <net/compat.h>
-
-/* 2.6.14 compat code goes here */
-
diff --git a/backport/compat/compat-2.6.18.c b/backport/compat/compat-2.6.18.c
deleted file mode 100644
index c7961ee..0000000
--- a/backport/compat/compat-2.6.18.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2007	Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 2.6.18.
- */
-
-#include <net/compat.h>
-
-/* 2.6.18 compat code goes here */
-
diff --git a/backport/compat/compat-2.6.19.c b/backport/compat/compat-2.6.19.c
deleted file mode 100644
index 60c3404..0000000
--- a/backport/compat/compat-2.6.19.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2007	Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 2.6.19.
- */
-
-#include <net/compat.h>
-
-/* 2.6.19 compat code goes here */
-
diff --git a/backport/compat/compat-2.6.21.c b/backport/compat/compat-2.6.21.c
deleted file mode 100644
index 7cf8861..0000000
--- a/backport/compat/compat-2.6.21.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2007	Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 2.6.21.
- */
-
-#include <net/compat.h>
-
-/* 2.6.21 compat code goes here */
-
diff --git a/backport/compat/compat-2.6.22.c b/backport/compat/compat-2.6.22.c
deleted file mode 100644
index d4df7b7..0000000
--- a/backport/compat/compat-2.6.22.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2007	Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 2.6.22.
- */
-
-#include <net/compat.h>
-
-/* 2.6.22 compat code goes here */
-
diff --git a/backport/compat/compat-2.6.23.c b/backport/compat/compat-2.6.23.c
deleted file mode 100644
index 1a76957..0000000
--- a/backport/compat/compat-2.6.23.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright 2007	Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 2.6.23.
- */
-
-#include <net/compat.h>
-
-/* On net/core/dev.c as of 2.6.24 */
-#define __dev_addr_delete LINUX_BACKPORT(__dev_addr_delete)
-int __dev_addr_delete(struct dev_addr_list **list, int *count,
-                      void *addr, int alen, int glbl)
-{
-	struct dev_addr_list *da;
-
-	for (; (da = *list) != NULL; list = &da->next) {
-		if (memcmp(da->da_addr, addr, da->da_addrlen) == 0 &&
-			alen == da->da_addrlen) {
-			if (glbl) {
-				int old_glbl = da->da_gusers;
-				da->da_gusers = 0;
-				if (old_glbl == 0)
-					break;
-			}
-			if (--da->da_users)
-				return 0;
-
-			*list = da->next;
-			kfree(da);
-			(*count)--;
-			return 0;
-		}
-	}
-	return -ENOENT;
-}
-EXPORT_SYMBOL_GPL(__dev_addr_delete);
-
-/* On net/core/dev.c as of 2.6.24. This is not yet used by mac80211 but
- * might as well add it */
-#define __dev_addr_add LINUX_BACKPORT(__dev_addr_add)
-int __dev_addr_add(struct dev_addr_list **list, int *count,
-                   void *addr, int alen, int glbl)
-{
-	struct dev_addr_list *da;
-
-	for (da = *list; da != NULL; da = da->next) {
-		if (memcmp(da->da_addr, addr, da->da_addrlen) == 0 &&
-			da->da_addrlen == alen) {
-			if (glbl) {
-				int old_glbl = da->da_gusers;
-				da->da_gusers = 1;
-				if (old_glbl)
-					return 0;
-			}
-			da->da_users++;
-			return 0;
-		}
-	}
-
-	da = kmalloc(sizeof(*da), GFP_ATOMIC);
-	if (da == NULL)
-		return -ENOMEM;
-	memcpy(da->da_addr, addr, alen);
-	da->da_addrlen = alen;
-	da->da_users = 1;
-	da->da_gusers = glbl ? 1 : 0;
-	da->next = *list;
-	*list = da;
-	(*count)++;
-	return 0;
-}
-EXPORT_SYMBOL_GPL(__dev_addr_add);
-
-
-/* Part of net/core/dev_mcast.c as of 2.6.23. This is a slightly different version.
- * Since da->da_synced is not part of 2.6.22 we need to take longer route when
- * syncing */
-
-/**
- *	dev_mc_sync	- Synchronize device's multicast list to another device
- *	@to: destination device
- *	@from: source device
- *
- * 	Add newly added addresses to the destination device and release
- * 	addresses that have no users left. The source device must be
- * 	locked by netif_tx_lock_bh.
- *
- *	This function is intended to be called from the dev->set_multicast_list
- *	function of layered software devices.
- */
-int dev_mc_sync(struct net_device *to, struct net_device *from)
-{
-	struct dev_addr_list *da, *next, *da_to;
-	int err = 0;
-
-	netif_tx_lock_bh(to);
-	da = from->mc_list;
-	while (da != NULL) {
-		int synced = 0;
-		next = da->next;
-		da_to = to->mc_list;
-		/* 2.6.22 does not have da->da_synced so lets take the long route */
-		while (da_to != NULL) {
-			if (memcmp(da_to->da_addr, da->da_addr, da_to->da_addrlen) == 0 &&
-				da->da_addrlen == da_to->da_addrlen)
-				synced = 1;
-				break;
-		}
-		if (!synced) {
-			err = __dev_addr_add(&to->mc_list, &to->mc_count,
-					     da->da_addr, da->da_addrlen, 0);
-			if (err < 0)
-				break;
-			da->da_users++;
-		} else if (da->da_users == 1) {
-			__dev_addr_delete(&to->mc_list, &to->mc_count,
-					  da->da_addr, da->da_addrlen, 0);
-			__dev_addr_delete(&from->mc_list, &from->mc_count,
-					  da->da_addr, da->da_addrlen, 0);
-		}
-		da = next;
-	}
-	if (!err)
-		__dev_set_rx_mode(to);
-	netif_tx_unlock_bh(to);
-
-	return err;
-}
-EXPORT_SYMBOL_GPL(dev_mc_sync);
-
-
-/* Part of net/core/dev_mcast.c as of 2.6.23. This is a slighty different version.
- * Since da->da_synced is not part of 2.6.22 we need to take longer route when
- * unsyncing */
-
-/**
- *      dev_mc_unsync   - Remove synchronized addresses from the destination
- *			  device
- *	@to: destination device
- *	@from: source device
- *
- *	Remove all addresses that were added to the destination device by
- *	dev_mc_sync(). This function is intended to be called from the
- *	dev->stop function of layered software devices.
- */
-void dev_mc_unsync(struct net_device *to, struct net_device *from)
-{
-	struct dev_addr_list *da, *next, *da_to;
-
-	netif_tx_lock_bh(from);
-	netif_tx_lock_bh(to);
-
-	da = from->mc_list;
-	while (da != NULL) {
-		bool synced = false;
-		next = da->next;
-		da_to = to->mc_list;
-		/* 2.6.22 does not have da->da_synced so lets take the long route */
-		while (da_to != NULL) {
-			if (memcmp(da_to->da_addr, da->da_addr, da_to->da_addrlen) == 0 &&
-				da->da_addrlen == da_to->da_addrlen)
-				synced = true;
-				break;
-		}
-		if (!synced) {
-			da = next;
-			continue;
-		}
-		__dev_addr_delete(&to->mc_list, &to->mc_count,
-			da->da_addr, da->da_addrlen, 0);
-		__dev_addr_delete(&from->mc_list, &from->mc_count,
-			da->da_addr, da->da_addrlen, 0);
-		da = next;
-	}
-	__dev_set_rx_mode(to);
-
-	netif_tx_unlock_bh(to);
-	netif_tx_unlock_bh(from);
-}
-EXPORT_SYMBOL_GPL(dev_mc_unsync);
-
-/* Added as of 2.6.23 on net/core/dev.c. Slightly modifed, no dev->set_rx_mode on
- * 2.6.22 so ignore that. */
-
-/*
- *	Upload unicast and multicast address lists to device and
- *	configure RX filtering. When the device doesn't support unicast
- *	filtering it is put in promiscous mode while unicast addresses
- *	are present.
- */
-void __dev_set_rx_mode(struct net_device *dev)
-{
-	/* dev_open will call this function so the list will stay sane. */
-	if (!(dev->flags&IFF_UP))
-		return;
-
-	if (!netif_device_present(dev))
-		return;
-
-/* This needs to be ported to 2.6.22 framework */
-#if 0
-	/* Unicast addresses changes may only happen under the rtnl,
-	 * therefore calling __dev_set_promiscuity here is safe.
-	 */
-	if (dev->uc_count > 0 && !dev->uc_promisc) {
-		__dev_set_promiscuity(dev, 1);
-		dev->uc_promisc = 1;
-	} else if (dev->uc_count == 0 && dev->uc_promisc) {
-		__dev_set_promiscuity(dev, -1);
-		dev->uc_promisc = 0;
-	}
-#endif
-
-	if (dev->set_multicast_list)
-		dev->set_multicast_list(dev);
-}
-
-/**
- * pci_try_set_mwi - enables memory-write-invalidate PCI transaction
- * @dev: the PCI device for which MWI is enabled
- *
- * Enables the Memory-Write-Invalidate transaction in %PCI_COMMAND.
- * Callers are not required to check the return value.
- *
- * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
- */
-int pci_try_set_mwi(struct pci_dev *dev)
-{
-	int rc = 0;
-#ifdef HAVE_PCI_SET_MWI
-	rc = pci_set_mwi(dev);
-#endif
-	return rc;
-}
-EXPORT_SYMBOL_GPL(pci_try_set_mwi);
-#endif
-
diff --git a/backport/compat/compat-2.6.24.c b/backport/compat/compat-2.6.24.c
deleted file mode 100644
index 977db0c..0000000
--- a/backport/compat/compat-2.6.24.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright 2007	Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 2.6.24.
- */
-
-#include <net/compat.h>
-#include <net/arp.h>
-
-/*
- * We simply won't use it though, just declare it for our wrappers and
- * for usage with tons of code that makes mention to it.
- */
-struct net init_net;
-EXPORT_SYMBOL_GPL(init_net);
-
-/* 2.6.22 and 2.6.23 have eth_header_cache_update defined as extern in include/linux/etherdevice.h
- * and actually defined in net/ethernet/eth.c but 2.6.24 exports it. Lets export it here */
-
-/**
- * eth_header_cache_update - update cache entry
- * @hh: destination cache entry
- * @dev: network device
- * @haddr: new hardware address
- *
- * Called by Address Resolution module to notify changes in address.
- */
-void eth_header_cache_update(struct hh_cache *hh,
-                             struct net_device *dev,
-                             unsigned char *haddr)
-{
-	memcpy(((u8 *) hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)),
-		haddr, ETH_ALEN);
-}
-EXPORT_SYMBOL_GPL(eth_header_cache_update);
-
-/* 2.6.22 and 2.6.23 have eth_header_cache defined as extern in include/linux/etherdevice.h
- * and actually defined in net/ethernet/eth.c but 2.6.24 exports it. Lets export it here */
-
-/**
- * eth_header_cache - fill cache entry from neighbour
- * @neigh: source neighbour
- * @hh: destination cache entry
- * Create an Ethernet header template from the neighbour.
- */
-int eth_header_cache(struct neighbour *neigh, struct hh_cache *hh)
-{
-	__be16 type = hh->hh_type;
-	struct ethhdr *eth;
-	const struct net_device *dev = neigh->dev;
-
-	eth = (struct ethhdr *)
-	    (((u8 *) hh->hh_data) + (HH_DATA_OFF(sizeof(*eth))));
-
-	if (type == htons(ETH_P_802_3))
-		return -1;
-
-	eth->h_proto = type;
-	memcpy(eth->h_source, dev->dev_addr, ETH_ALEN);
-	memcpy(eth->h_dest, neigh->ha, ETH_ALEN);
-	hh->hh_len = ETH_HLEN;
-	return 0;
-}
-EXPORT_SYMBOL_GPL(eth_header_cache);
-
-/* 2.6.22 and 2.6.23 have eth_header() defined as extern in include/linux/etherdevice.h
- * and actually defined in net/ethernet/eth.c but 2.6.24 exports it. Lets export it here */
-
-/**
- * eth_header - create the Ethernet header
- * @skb:	buffer to alter
- * @dev:	source device
- * @type:	Ethernet type field
- * @daddr: destination address (NULL leave destination address)
- * @saddr: source address (NULL use device source address)
- * @len:   packet length (<= skb->len)
- *
- *
- * Set the protocol type. For a packet of type ETH_P_802_3 we put the length
- * in here instead. It is up to the 802.2 layer to carry protocol information.
- */
-int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
-	       void *daddr, void *saddr, unsigned len)
-{
-	struct ethhdr *eth = (struct ethhdr *)skb_push(skb, ETH_HLEN);
-
-	if (type != ETH_P_802_3)
-		eth->h_proto = htons(type);
-	else
-		eth->h_proto = htons(len);
-
-	/*
-	 *      Set the source hardware address.
-	 */
-
-	if (!saddr)
-		saddr = dev->dev_addr;
-	memcpy(eth->h_source, saddr, dev->addr_len);
-
-	if (daddr) {
-		memcpy(eth->h_dest, daddr, dev->addr_len);
-		return ETH_HLEN;
-	}
-
-	/*
-	 *      Anyway, the loopback-device should never use this function...
-	 */
-
-	if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) {
-		memset(eth->h_dest, 0, dev->addr_len);
-		return ETH_HLEN;
-	}
-
-	return -ETH_HLEN;
-}
-
-EXPORT_SYMBOL_GPL(eth_header);
-
-/* 2.6.22 and 2.6.23 have eth_rebuild_header defined as extern in include/linux/etherdevice.h
- * and actually defined in net/ethernet/eth.c but 2.6.24 exports it. Lets export it here */
-
-/**
- * eth_rebuild_header- rebuild the Ethernet MAC header.
- * @skb: socket buffer to update
- *
- * This is called after an ARP or IPV6 ndisc it's resolution on this
- * sk_buff. We now let protocol (ARP) fill in the other fields.
- *
- * This routine CANNOT use cached dst->neigh!
- * Really, it is used only when dst->neigh is wrong.
- */
-int eth_rebuild_header(struct sk_buff *skb)
-{
-	struct ethhdr *eth = (struct ethhdr *)skb->data;
-	struct net_device *dev = skb->dev;
-
-	switch (eth->h_proto) {
-#ifdef CONFIG_INET
-	case __constant_htons(ETH_P_IP):
-		return arp_find(eth->h_dest, skb);
-#endif
-	default:
-		printk(KERN_DEBUG
-		       "%s: unable to resolve type %X addresses.\n",
-		       dev->name, (int)eth->h_proto);
-
-		memcpy(eth->h_source, dev->dev_addr, ETH_ALEN);
-		break;
-	}
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(eth_rebuild_header);
-
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 07/42] backports: remove __inet_lookup_established
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (5 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 06/42] backports: remove support for < 2.6.24 Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 08/42] backports: dissolve compat-3.9.h Johannes Berg
                   ` (37 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-2.6.25.h | 47 -------------------------
 1 file changed, 47 deletions(-)

diff --git a/backport/backport-include/linux/compat-2.6.25.h b/backport/backport-include/linux/compat-2.6.25.h
index dd986f5..9a2afdb 100644
--- a/backport/backport-include/linux/compat-2.6.25.h
+++ b/backport/backport-include/linux/compat-2.6.25.h
@@ -21,10 +21,6 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/scatterlist.h>
-#define __inet_lookup_established __inet_lookup_established_old
-#include <net/inet_hashtables.h>
-#undef __inet_lookup_established
-#include <linux/compat-3.9.h>
 
 struct sg_table {
 	struct scatterlist *sgl;        /* the list */
@@ -57,49 +53,6 @@ int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask);
 #define SG_MAX_SINGLE_ALLOC            (PAGE_SIZE / sizeof(struct scatterlist))
 
 
-/*
- * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so we need
- * not check it for lookups anymore, thanks Alexey. -DaveM
- *
- * Local BH must be disabled here.
- */
-static inline struct sock *
-	__inet_lookup_established(struct inet_hashinfo *hashinfo,
-				  const __be32 saddr, const __be16 sport,
-				  const __be32 daddr, const u16 hnum,
-				  const int dif)
-{
-	INET_ADDR_COOKIE(acookie, saddr, daddr)
-	const __portpair ports = INET_COMBINED_PORTS(sport, hnum);
-	struct sock *sk;
-	/* Optimize here for direct hit, only listening connections can
-	 * have wildcards anyways.
-	 */
-	unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport);
-	struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash);
-	rwlock_t *lock = inet_ehash_lockp(hashinfo, hash);
-
-	prefetch(head->chain.first);
-	read_lock(lock);
-	sk_for_each(sk, &head->chain) {
-		if (INET_MATCH(sk, hash, acookie, saddr, daddr, ports, dif))
-			goto hit; /* You sunk my battleship! */
-	}
-
-	/* Must check for a TIME_WAIT'er before going to listener hash. */
-	sk_for_each(sk, &head->twchain) {
-		if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif))
-			goto hit;
-	}
-	sk = NULL;
-out:
-	read_unlock(lock);
-	return sk;
-hit:
-	sock_hold(sk);
-	goto out;
-}
-
 /* Backports b718989da7 */
 #define pci_enable_device_mem LINUX_BACKPORT(pci_enable_device_mem)
 int __must_check pci_enable_device_mem(struct pci_dev *dev);
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 08/42] backports: dissolve compat-3.9.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (6 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 07/42] backports: remove __inet_lookup_established Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 09/42] backports: dissolve compat-3.10.h Johannes Berg
                   ` (36 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Move everything into the appropriate header files.

Also include uidgid.h into the new fs.h since kernels
that had uidgid.h include it already, so it doesn't
change anything there, but those that don't have it
obviously can't have included it and people rely on
it behing included there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/backport/backport.h      |   1 -
 backport/backport-include/backport/magic.h         |  16 ++
 backport/backport-include/linux/compat-2.6.29.h    |   1 +
 backport/backport-include/linux/compat-3.6.h       |   1 +
 backport/backport-include/linux/compat-3.9.h       | 243 ---------------------
 backport/backport-include/linux/device.h           |  13 ++
 backport/backport-include/linux/fs.h               |  27 +++
 backport/backport-include/linux/idr.h              |  50 +++++
 backport/backport-include/linux/list.h             |  53 +++++
 backport/backport-include/linux/platform_device.h  |  22 ++
 backport/backport-include/linux/printk.h           |  26 +++
 backport/backport-include/linux/rculist.h          |  27 +++
 backport/backport-include/linux/scatterlist.h      |  51 +++++
 backport/backport-include/linux/tty_flip.h         |  11 +
 backport/backport-include/media/videobuf2-memops.h |  14 ++
 backport/backport-include/net/sock.h               |  30 +++
 16 files changed, 342 insertions(+), 244 deletions(-)
 create mode 100644 backport/backport-include/backport/magic.h
 delete mode 100644 backport/backport-include/linux/compat-3.9.h
 create mode 100644 backport/backport-include/linux/device.h
 create mode 100644 backport/backport-include/linux/fs.h
 create mode 100644 backport/backport-include/linux/idr.h
 create mode 100644 backport/backport-include/linux/list.h
 create mode 100644 backport/backport-include/linux/platform_device.h
 create mode 100644 backport/backport-include/linux/rculist.h
 create mode 100644 backport/backport-include/linux/scatterlist.h
 create mode 100644 backport/backport-include/linux/tty_flip.h
 create mode 100644 backport/backport-include/media/videobuf2-memops.h
 create mode 100644 backport/backport-include/net/sock.h

diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index 97e5316..e343bf8 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -80,7 +80,6 @@ void backport_dependency_symbol(void);
 #include <linux/compat-3.6.h>
 #include <linux/compat-3.7.h>
 #include <linux/compat-3.8.h>
-#include <linux/compat-3.9.h>
 #include <linux/compat-3.10.h>
 
 #endif /* __ASSEMBLY__ */
diff --git a/backport/backport-include/backport/magic.h b/backport/backport-include/backport/magic.h
new file mode 100644
index 0000000..222e025
--- /dev/null
+++ b/backport/backport-include/backport/magic.h
@@ -0,0 +1,16 @@
+/*
+ * These tricks are taken from
+ * http://efesx.com/2010/07/17/variadic-macro-to-count-number-of-arguments/
+ * and
+ * http://efesx.com/2010/08/31/overloading-macros/
+ */
+
+#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL(__VA_ARGS__, 5,4,3,2,1)
+#define VA_NUM_ARGS_IMPL(_1,_2,_3,_4,_5,N,...) N
+
+#define macro_dispatcher(func, ...) \
+	macro_dispatcher_(func, VA_NUM_ARGS(__VA_ARGS__))
+#define macro_dispatcher_(func, nargs) \
+	macro_dispatcher__(func, nargs)
+#define macro_dispatcher__(func, nargs) \
+	func ## nargs
diff --git a/backport/backport-include/linux/compat-2.6.29.h b/backport/backport-include/linux/compat-2.6.29.h
index c8cf898..adcde36 100644
--- a/backport/backport-include/linux/compat-2.6.29.h
+++ b/backport/backport-include/linux/compat-2.6.29.h
@@ -2,6 +2,7 @@
 #define LINUX_26_29_COMPAT_H
 
 #include <linux/version.h>
+struct net_device;
 #include <linux/netdevice.h>
 #include <linux/if_link.h>
 
diff --git a/backport/backport-include/linux/compat-3.6.h b/backport/backport-include/linux/compat-3.6.h
index f2c1a90..770a333 100644
--- a/backport/backport-include/linux/compat-3.6.h
+++ b/backport/backport-include/linux/compat-3.6.h
@@ -33,6 +33,7 @@ dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
 		       void *cpu_addr, dma_addr_t dma_addr, size_t size);
 
 #define dma_get_sgtable_attrs LINUX_BACKPORT(dma_get_sgtable_attrs)
+struct dma_attrs;
 static inline int
 dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, void *cpu_addr,
 		      dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs)
diff --git a/backport/backport-include/linux/compat-3.9.h b/backport/backport-include/linux/compat-3.9.h
deleted file mode 100644
index a939e0b..0000000
--- a/backport/backport-include/linux/compat-3.9.h
+++ /dev/null
@@ -1,243 +0,0 @@
-#ifndef LINUX_3_9_COMPAT_H
-#define LINUX_3_9_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0))
-
-#include <linux/idr.h>
-#include <linux/list.h>
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25))
-#include <linux/rculist.h>
-#endif
-#include <net/sock.h>
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/printk.h>
-#include <linux/scatterlist.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-int vb2_mmap_pfn_range(struct vm_area_struct *vma, unsigned long paddr,
-				unsigned long size,
-				const struct vm_operations_struct *vm_ops,
-				void *priv);
-#endif
-
-/* module_platform_driver_probe() - Helper macro for drivers that don't do
- * anything special in module init/exit.  This eliminates a lot of
- * boilerplate.  Each module may only use this macro once, and
- * calling it replaces module_init() and module_exit()
- */
-#define module_platform_driver_probe(__platform_driver, __platform_probe) \
-static int __init __platform_driver##_init(void) \
-{ \
-	return platform_driver_probe(&(__platform_driver), \
-				     __platform_probe);    \
-} \
-module_init(__platform_driver##_init); \
-static void __exit __platform_driver##_exit(void) \
-{ \
-	platform_driver_unregister(&(__platform_driver)); \
-} \
-module_exit(__platform_driver##_exit);
-
-
-/* include this before changing hlist_for_each_* to use the old versions. */
-#include <net/sch_generic.h>
-
-/* Lets expect distributions might backport this */
-
-#ifndef for_each_sg_page
-/*
- * sg page iterator
- *
- * Iterates over sg entries page-by-page.  On each successful iteration,
- * @piter->page points to the current page, @piter->sg to the sg holding this
- * page and @piter->sg_pgoffset to the page's page offset within the sg. The
- * iteration will stop either when a maximum number of sg entries was reached
- * or a terminating sg (sg_last(sg) == true) was reached.
- */
-struct sg_page_iter {
-	struct page		*page;		/* current page */
-	struct scatterlist	*sg;		/* sg holding the page */
-	unsigned int		sg_pgoffset;	/* page offset within the sg */
-
-	/* these are internal states, keep away */
-	unsigned int		__nents;	/* remaining sg entries */
-	int			__pg_advance;	/* nr pages to advance at the
-						 * next step */
-};
-
-#define __sg_page_iter_next LINUX_BACKPORT(__sg_page_iter_next)
-bool __sg_page_iter_next(struct sg_page_iter *piter);
-#define __sg_page_iter_start LINUX_BACKPORT(__sg_page_iter_start)
-void __sg_page_iter_start(struct sg_page_iter *piter,
-			  struct scatterlist *sglist, unsigned int nents,
-			  unsigned long pgoffset);
-
-/**
- * for_each_sg_page - iterate over the pages of the given sg list
- * @sglist:	sglist to iterate over
- * @piter:	page iterator to hold current page, sg, sg_pgoffset
- * @nents:	maximum number of sg entries to iterate over
- * @pgoffset:	starting page offset
- */
-#define for_each_sg_page(sglist, piter, nents, pgoffset)		   \
-	for (__sg_page_iter_start((piter), (sglist), (nents), (pgoffset)); \
-	     __sg_page_iter_next(piter);)
-
-#endif /* for_each_sg_page assumption */
-
-/* backports 7a555613 */
-#if defined(CONFIG_DYNAMIC_DEBUG)
-#define dynamic_hex_dump(prefix_str, prefix_type, rowsize,     \
-			 groupsize, buf, len, ascii)            \
-do {                                                           \
-	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor,               \
-	__builtin_constant_p(prefix_str) ? prefix_str : "hexdump");\
-	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT))  \
-		print_hex_dump(KERN_DEBUG, prefix_str,          \
-			       prefix_type, rowsize, groupsize, \
-			       buf, len, ascii);                \
-} while (0)
-#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
-			     groupsize, buf, len, ascii)        \
-	dynamic_hex_dump(prefix_str, prefix_type, rowsize,      \
-			 groupsize, buf, len, ascii)
-#else
-#define print_hex_dump_debug(prefix_str, prefix_type, rowsize,         \
-			     groupsize, buf, len, ascii)                \
-	print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize,    \
-		       groupsize, buf, len, ascii)
-#endif /* defined(CONFIG_DYNAMIC_DEBUG) */
-
-
-/**
- * backport of idr idr_alloc() usage
- * 
- * This backports a patch series send by Tejun Heo:
- * https://lkml.org/lkml/2013/2/2/159
- */
-static inline void compat_idr_destroy(struct idr *idp)
-{
-	idr_remove_all(idp);
-	idr_destroy(idp);
-}
-#define idr_destroy(idp) compat_idr_destroy(idp)
-
-static inline int idr_alloc(struct idr *idr, void *ptr, int start, int end,
-			    gfp_t gfp_mask)
-{
-	int id, ret;
-
-	do {
-		if (!idr_pre_get(idr, gfp_mask))
-			return -ENOMEM;
-		ret = idr_get_new_above(idr, ptr, start, &id);
-		if (!ret && id > end) {
-			idr_remove(idr, id);
-			ret = -ENOSPC;
-		}
-	} while (ret == -EAGAIN);
-
-	return ret ? ret : id;
-}
-
-static inline void idr_preload(gfp_t gfp_mask)
-{
-}
-
-static inline void idr_preload_end(void)
-{
-}
-
-
-/**
- * backport:
- *
- * commit 0bbacca7c3911451cea923b0ad6389d58e3d9ce9
- * Author: Sasha Levin <sasha.levin@oracle.com>
- * Date:   Thu Feb 7 12:32:18 2013 +1100
- *
- *     hlist: drop the node parameter from iterators
- */
-
-#define hlist_entry_safe(ptr, type, member) \
-	(ptr) ? hlist_entry(ptr, type, member) : NULL
-
-#undef hlist_for_each_entry
-/**
- * hlist_for_each_entry	- iterate over list of given type
- * @pos:	the type * to use as a loop cursor.
- * @head:	the head for your list.
- * @member:	the name of the hlist_node within the struct.
- */
-#define hlist_for_each_entry(pos, head, member)					\
-	for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);	\
-	     pos;								\
-	     pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
-
-#undef hlist_for_each_entry_safe
-/**
- * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
- * @pos:	the type * to use as a loop cursor.
- * @n:		another &struct hlist_node to use as temporary storage
- * @head:	the head for your list.
- * @member:	the name of the hlist_node within the struct.
- */
-#define hlist_for_each_entry_safe(pos, n, head, member) 			\
-	for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);	\
-	     pos && ({ n = pos->member.next; 1; });				\
-	     pos = hlist_entry_safe(n, typeof(*pos), member))
-
-#undef hlist_for_each_entry_rcu
-/**
- * hlist_for_each_entry_rcu - iterate over rcu list of given type
- * @pos:	the type * to use as a loop cursor.
- * @head:	the head for your list.
- * @member:	the name of the hlist_node within the struct.
- *
- * This list-traversal primitive may safely run concurrently with
- * the _rcu list-mutation primitives such as hlist_add_head_rcu()
- * as long as the traversal is guarded by rcu_read_lock().
- */
-#define hlist_for_each_entry_rcu(pos, head, member)				\
-	for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\
-			typeof(*(pos)), member);				\
-		pos;								\
-		pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(	\
-			&(pos)->member)), typeof(*(pos)), member))
-
-#undef sk_for_each
-#define sk_for_each(__sk, list) \
-	hlist_for_each_entry(__sk, list, sk_node)
-
-#undef sk_for_each_safe
-#define sk_for_each_safe(__sk, tmp, list) \
-	hlist_for_each_entry_safe(__sk, tmp, list, sk_node)
-
-#define tty_flip_buffer_push(port) tty_flip_buffer_push((port)->tty)
-#define tty_insert_flip_string(port, chars, size) tty_insert_flip_string((port)->tty, chars, size)
-
-/**
- * backport of:
- *
- * commit 496ad9aa8ef448058e36ca7a787c61f2e63f0f54
- * Author: Al Viro <viro@zeniv.linux.org.uk>
- * Date:   Wed Jan 23 17:07:38 2013 -0500
- *
- *     new helper: file_inode(file)
- */
-static inline struct inode *file_inode(struct file *f)
-{
-	return f->f_path.dentry->d_inode;
-}
-
-#define devm_ioremap_resource LINUX_BACKPORT(devm_ioremap_resource)
-void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) */
-
-#endif /* LINUX_3_9_COMPAT_H */
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
new file mode 100644
index 0000000..e10360b
--- /dev/null
+++ b/backport/backport-include/linux/device.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_DEVICE_H
+#define __BACKPORT_DEVICE_H
+#include <linux/export.h>
+#include_next <linux/device.h>
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#define devm_ioremap_resource LINUX_BACKPORT(devm_ioremap_resource)
+void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
+#endif
+
+#endif /* __BACKPORT_DEVICE_H */
diff --git a/backport/backport-include/linux/fs.h b/backport/backport-include/linux/fs.h
new file mode 100644
index 0000000..746c7d1
--- /dev/null
+++ b/backport/backport-include/linux/fs.h
@@ -0,0 +1,27 @@
+#ifndef _COMPAT_LINUX_FS_H
+#define _COMPAT_LINUX_FS_H
+#include_next <linux/fs.h>
+#include <linux/version.h>
+/*
+ * some versions don't have this and thus don't
+ * include it from the original fs.h
+ */
+#include <linux/uidgid.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+/**
+ * backport of:
+ *
+ * commit 496ad9aa8ef448058e36ca7a787c61f2e63f0f54
+ * Author: Al Viro <viro@zeniv.linux.org.uk>
+ * Date:   Wed Jan 23 17:07:38 2013 -0500
+ *
+ *     new helper: file_inode(file)
+ */
+static inline struct inode *file_inode(struct file *f)
+{
+	return f->f_path.dentry->d_inode;
+}
+#endif
+
+#endif	/* _COMPAT_LINUX_FS_H */
diff --git a/backport/backport-include/linux/idr.h b/backport/backport-include/linux/idr.h
new file mode 100644
index 0000000..0a0fc94
--- /dev/null
+++ b/backport/backport-include/linux/idr.h
@@ -0,0 +1,50 @@
+#ifndef __BACKPORT_IDR_H
+#define __BACKPORT_IDR_H
+/* some versions have a broken idr header */
+#include <linux/spinlock.h>
+#include_next <linux/idr.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#include <linux/errno.h>
+/**
+ * backport of idr idr_alloc() usage
+ * 
+ * This backports a patch series send by Tejun Heo:
+ * https://lkml.org/lkml/2013/2/2/159
+ */
+static inline void compat_idr_destroy(struct idr *idp)
+{
+	idr_remove_all(idp);
+	idr_destroy(idp);
+}
+#define idr_destroy(idp) compat_idr_destroy(idp)
+
+static inline int idr_alloc(struct idr *idr, void *ptr, int start, int end,
+			    gfp_t gfp_mask)
+{
+	int id, ret;
+
+	do {
+		if (!idr_pre_get(idr, gfp_mask))
+			return -ENOMEM;
+		ret = idr_get_new_above(idr, ptr, start, &id);
+		if (!ret && id > end) {
+			idr_remove(idr, id);
+			ret = -ENOSPC;
+		}
+	} while (ret == -EAGAIN);
+
+	return ret ? ret : id;
+}
+
+static inline void idr_preload(gfp_t gfp_mask)
+{
+}
+
+static inline void idr_preload_end(void)
+{
+}
+#endif
+
+#endif /* __BACKPORT_IDR_H */
diff --git a/backport/backport-include/linux/list.h b/backport/backport-include/linux/list.h
new file mode 100644
index 0000000..a02e0dd
--- /dev/null
+++ b/backport/backport-include/linux/list.h
@@ -0,0 +1,53 @@
+#ifndef __BACKPORT_LIST_H
+#define __BACKPORT_LIST_H
+#include_next <linux/list.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+/**
+ * backport:
+ *
+ * commit 0bbacca7c3911451cea923b0ad6389d58e3d9ce9
+ * Author: Sasha Levin <sasha.levin@oracle.com>
+ * Date:   Thu Feb 7 12:32:18 2013 +1100
+ *
+ *     hlist: drop the node parameter from iterators
+ */
+#include <backport/magic.h>
+
+#undef hlist_entry_safe
+#define hlist_entry_safe(ptr, type, member) \
+	(ptr) ? hlist_entry(ptr, type, member) : NULL
+
+#define hlist_for_each_entry4(tpos, pos, head, member)			\
+	for (pos = (head)->first;					\
+	     pos &&							\
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;});\
+	     pos = pos->next)
+
+#define hlist_for_each_entry_safe5(tpos, pos, n, head, member)		\
+	for (pos = (head)->first;					\
+	     pos && ({ n = pos->next; 1; }) &&				\
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;});\
+	     pos = n)
+
+#define hlist_for_each_entry3(pos, head, member)				\
+	for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);	\
+	     pos;								\
+	     pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
+
+#define hlist_for_each_entry_safe4(pos, n, head, member) 			\
+	for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);	\
+	     pos && ({ n = pos->member.next; 1; });				\
+	     pos = hlist_entry_safe(n, typeof(*pos), member))
+
+#undef hlist_for_each_entry
+#define hlist_for_each_entry(...) \
+	macro_dispatcher(hlist_for_each_entry, __VA_ARGS__)(__VA_ARGS__)
+#undef hlist_for_each_entry_safe
+#define hlist_for_each_entry_safe(...) \
+	macro_dispatcher(hlist_for_each_entry_safe, __VA_ARGS__)(__VA_ARGS__)
+
+#endif
+
+#endif /* __BACKPORT_LIST_H */
diff --git a/backport/backport-include/linux/platform_device.h b/backport/backport-include/linux/platform_device.h
new file mode 100644
index 0000000..acb4aba
--- /dev/null
+++ b/backport/backport-include/linux/platform_device.h
@@ -0,0 +1,22 @@
+#ifndef __BACKPORT_PLATFORM_DEVICE_H
+#define __BACKPORT_PLATFORM_DEVICE_H
+
+#include_next <linux/platform_device.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#define module_platform_driver_probe(__platform_driver, __platform_probe) \
+static int __init __platform_driver##_init(void) \
+{ \
+	return platform_driver_probe(&(__platform_driver), \
+				     __platform_probe);    \
+} \
+module_init(__platform_driver##_init); \
+static void __exit __platform_driver##_exit(void) \
+{ \
+	platform_driver_unregister(&(__platform_driver)); \
+} \
+module_exit(__platform_driver##_exit);
+#endif
+
+#endif /* __BACKPORT_PLATFORM_DEVICE_H */
diff --git a/backport/backport-include/linux/printk.h b/backport/backport-include/linux/printk.h
index c0822ac..a255045 100644
--- a/backport/backport-include/linux/printk.h
+++ b/backport/backport-include/linux/printk.h
@@ -9,4 +9,30 @@
 #include <linux/kernel.h>
 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35)) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+/* backports 7a555613 */
+#if defined(CONFIG_DYNAMIC_DEBUG)
+#define dynamic_hex_dump(prefix_str, prefix_type, rowsize,     \
+			 groupsize, buf, len, ascii)            \
+do {                                                           \
+	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor,               \
+	__builtin_constant_p(prefix_str) ? prefix_str : "hexdump");\
+	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT))  \
+		print_hex_dump(KERN_DEBUG, prefix_str,          \
+			       prefix_type, rowsize, groupsize, \
+			       buf, len, ascii);                \
+} while (0)
+#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
+			     groupsize, buf, len, ascii)        \
+	dynamic_hex_dump(prefix_str, prefix_type, rowsize,      \
+			 groupsize, buf, len, ascii)
+#else
+#define print_hex_dump_debug(prefix_str, prefix_type, rowsize,         \
+			     groupsize, buf, len, ascii)                \
+	print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize,    \
+		       groupsize, buf, len, ascii)
+#endif /* defined(CONFIG_DYNAMIC_DEBUG) */
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) */
+
 #endif	/* _COMPAT_LINUX_PRINTK_H */
diff --git a/backport/backport-include/linux/rculist.h b/backport/backport-include/linux/rculist.h
new file mode 100644
index 0000000..0f5eaf1
--- /dev/null
+++ b/backport/backport-include/linux/rculist.h
@@ -0,0 +1,27 @@
+#ifndef __BACKPORT_RCULIST_H
+#define __BACKPORT_RCULIST_H
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+#include_next <linux/rculist.h>
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#include <backport/magic.h>
+#define hlist_for_each_entry_rcu4(tpos, pos, head, member)		\
+	for (pos = rcu_dereference_raw(hlist_first_rcu(head));		\
+	     pos &&							\
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; });\
+	     pos = rcu_dereference_raw(hlist_next_rcu(pos)))
+
+#define hlist_for_each_entry_rcu3(pos, head, member)				\
+	for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\
+			typeof(*(pos)), member);				\
+		pos;								\
+		pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(	\
+			&(pos)->member)), typeof(*(pos)), member))
+
+#undef hlist_for_each_entry_rcu
+#define hlist_for_each_entry_rcu(...) \
+	macro_dispatcher(hlist_for_each_entry_rcu, __VA_ARGS__)(__VA_ARGS__)
+#endif /* < 3.9 */
+
+#endif /* __BACKPORT_RCULIST_H */
diff --git a/backport/backport-include/linux/scatterlist.h b/backport/backport-include/linux/scatterlist.h
new file mode 100644
index 0000000..aaa7371
--- /dev/null
+++ b/backport/backport-include/linux/scatterlist.h
@@ -0,0 +1,51 @@
+#ifndef __BACKPORT_SCATTERLIST_H
+#define __BACKPORT_SCATTERLIST_H
+#include_next <linux/scatterlist.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+
+/* Lets expect distributions might backport this */
+#ifndef for_each_sg_page
+/*
+ * sg page iterator
+ *
+ * Iterates over sg entries page-by-page.  On each successful iteration,
+ * @piter->page points to the current page, @piter->sg to the sg holding this
+ * page and @piter->sg_pgoffset to the page's page offset within the sg. The
+ * iteration will stop either when a maximum number of sg entries was reached
+ * or a terminating sg (sg_last(sg) == true) was reached.
+ */
+struct sg_page_iter {
+	struct page		*page;		/* current page */
+	struct scatterlist	*sg;		/* sg holding the page */
+	unsigned int		sg_pgoffset;	/* page offset within the sg */
+
+	/* these are internal states, keep away */
+	unsigned int		__nents;	/* remaining sg entries */
+	int			__pg_advance;	/* nr pages to advance at the
+						 * next step */
+};
+
+#define __sg_page_iter_next LINUX_BACKPORT(__sg_page_iter_next)
+bool __sg_page_iter_next(struct sg_page_iter *piter);
+#define __sg_page_iter_start LINUX_BACKPORT(__sg_page_iter_start)
+void __sg_page_iter_start(struct sg_page_iter *piter,
+			  struct scatterlist *sglist, unsigned int nents,
+			  unsigned long pgoffset);
+
+/**
+ * for_each_sg_page - iterate over the pages of the given sg list
+ * @sglist:	sglist to iterate over
+ * @piter:	page iterator to hold current page, sg, sg_pgoffset
+ * @nents:	maximum number of sg entries to iterate over
+ * @pgoffset:	starting page offset
+ */
+#define for_each_sg_page(sglist, piter, nents, pgoffset)		   \
+	for (__sg_page_iter_start((piter), (sglist), (nents), (pgoffset)); \
+	     __sg_page_iter_next(piter);)
+
+#endif /* for_each_sg_page assumption */
+#endif /* version < 3.9 */
+
+#endif /* __BACKPORT_SCATTERLIST_H */
diff --git a/backport/backport-include/linux/tty_flip.h b/backport/backport-include/linux/tty_flip.h
new file mode 100644
index 0000000..67ecd61
--- /dev/null
+++ b/backport/backport-include/linux/tty_flip.h
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_TTY_FLIP_H
+#define __BACKPORT_TTY_FLIP_H
+#include_next <linux/tty_flip.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#define tty_flip_buffer_push(port) tty_flip_buffer_push((port)->tty)
+#define tty_insert_flip_string(port, chars, size) tty_insert_flip_string((port)->tty, chars, size)
+#endif
+
+#endif /* __BACKPORT_TTY_FLIP_H */
diff --git a/backport/backport-include/media/videobuf2-memops.h b/backport/backport-include/media/videobuf2-memops.h
new file mode 100644
index 0000000..78ec8e4
--- /dev/null
+++ b/backport/backport-include/media/videobuf2-memops.h
@@ -0,0 +1,14 @@
+#ifndef __BACKPORT_MEDIA_VB2_MEMOPS_H
+#define __BACKPORT_MEDIA_VB2_MEMOPS_H
+#include_next <media/videobuf2-memops.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+int vb2_mmap_pfn_range(struct vm_area_struct *vma, unsigned long paddr,
+				unsigned long size,
+				const struct vm_operations_struct *vm_ops,
+				void *priv);
+#endif
+
+#endif /* __BACKPORT_MEDIA_VB2_MEMOPS_H */
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
new file mode 100644
index 0000000..c9ec1fc
--- /dev/null
+++ b/backport/backport-include/net/sock.h
@@ -0,0 +1,30 @@
+#ifndef __BACKPORT_NET_SOCK_H
+#define __BACKPORT_NET_SOCK_H
+#include_next <net/sock.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#include <backport/magic.h>
+
+#define sk_for_each3(__sk, node, list) \
+	hlist_for_each_entry(__sk, node, list, sk_node)
+
+#define sk_for_each_safe4(__sk, node, tmp, list) \
+	hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node)
+
+#define sk_for_each2(__sk, list) \
+	hlist_for_each_entry(__sk, list, sk_node)
+
+#define sk_for_each_safe3(__sk, tmp, list) \
+	hlist_for_each_entry_safe(__sk, tmp, list, sk_node)
+
+#undef sk_for_each
+#define sk_for_each(...) \
+	macro_dispatcher(sk_for_each, __VA_ARGS__)(__VA_ARGS__)
+#undef sk_for_each_safe
+#define sk_for_each_safe(...) \
+	macro_dispatcher(sk_for_each_safe, __VA_ARGS__)(__VA_ARGS__)
+
+#endif
+
+#endif /* __BACKPORT_NET_SOCK_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 09/42] backports: dissolve compat-3.10.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (7 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 08/42] backports: dissolve compat-3.9.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 10/42] backports: dissolve compat-2.6.25.h Johannes Berg
                   ` (35 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/backport/backport.h |   1 -
 backport/backport-include/linux/compat-3.10.h | 145 --------------------------
 backport/backport-include/linux/fb.h          |  48 +++++++++
 backport/backport-include/linux/if_ether.h    |  17 +++
 backport/backport-include/linux/pci.h         |  17 +++
 backport/backport-include/linux/proc_fs.h     |  17 +++
 backport/backport-include/linux/scatterlist.h |  24 +++++
 backport/backport-include/linux/socket.h      |  13 +++
 backport/backport-include/net/sock.h          |  11 ++
 backport/backport-include/pcmcia/ds.h         |  29 ++++++
 10 files changed, 176 insertions(+), 146 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-3.10.h
 create mode 100644 backport/backport-include/linux/fb.h
 create mode 100644 backport/backport-include/linux/if_ether.h
 create mode 100644 backport/backport-include/linux/pci.h
 create mode 100644 backport/backport-include/linux/proc_fs.h
 create mode 100644 backport/backport-include/linux/socket.h
 create mode 100644 backport/backport-include/pcmcia/ds.h

diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index e343bf8..a50e488 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -80,7 +80,6 @@ void backport_dependency_symbol(void);
 #include <linux/compat-3.6.h>
 #include <linux/compat-3.7.h>
 #include <linux/compat-3.8.h>
-#include <linux/compat-3.10.h>
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/backport/backport-include/linux/compat-3.10.h b/backport/backport-include/linux/compat-3.10.h
deleted file mode 100644
index b4d8bc5..0000000
--- a/backport/backport-include/linux/compat-3.10.h
+++ /dev/null
@@ -1,145 +0,0 @@
-#ifndef LINUX_3_10_COMPAT_H
-#define LINUX_3_10_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
-
-#include <linux/scatterlist.h>
-#include <linux/mm.h>
-#include <linux/fb.h>
-#include <linux/proc_fs.h>
-#include <linux/printk.h>
-
-#define sg_page_iter_page LINUX_BACKPORT(sg_page_iter_page)
-/**
- * sg_page_iter_page - get the current page held by the page iterator
- * @piter:     page iterator holding the page
- */
-static inline struct page *sg_page_iter_page(struct sg_page_iter *piter)
-{
-	return nth_page(sg_page(piter->sg), piter->sg_pgoffset);
-}
-
-#define sg_page_iter_dma_address LINUX_BACKPORT(sg_page_iter_dma_address)
-/**
- * sg_page_iter_dma_address - get the dma address of the current page held by
- * the page iterator.
- * @piter:     page iterator holding the page
- */
-static inline dma_addr_t sg_page_iter_dma_address(struct sg_page_iter *piter)
-{
-	return sg_dma_address(piter->sg) + (piter->sg_pgoffset << PAGE_SHIFT);
-}
-
-/*
- * This is a linux-next data structure element collateral evolution,
- * we use a wrapper to avoid #ifdef hell to backport it. This allows
- * us to use a simple fb_info_skip_vt_switch() replacement for when
- * the new data structure element is used. If coccinelle SmPL grammar
- * could be used to express the transformation for us on compat-drivers
- * it means we'd need to express it only once. If the structure element
- * collateral evolution were to be used *at development* time and we'd
- * have a way to express the inverse through SmPL we'd be able to
- * backport this collateral evolution automatically for any new driver
- * that used it. We'd use coccinelle to look for it and do the
- * transformations for us based on the original commit (maybe SmPL
- * would be listed on the commit log.
- *
- * We may need the LINUX_BACKPORT() call that adds the backport_
- * prefix for older kernels than 3.10 if distros decide to
- * add this same static inline themselves (although unlikely).
- */
-#define fb_enable_skip_vt_switch LINUX_BACKPORT(fb_enable_skip_vt_switch)
-static inline void fb_enable_skip_vt_switch(struct fb_info *info)
-{
-}
-
-/**
- * backport of:
- *
- * commit 6ed7ffddcf61f668114edb676417e5fb33773b59
- * Author: H Hartley Sweeten <hsweeten@visionengravers.com>
- * Date:   Wed Mar 6 11:24:44 2013 -0700
- *
- *     pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate
- */
-
-/**
- * module_pcmcia_driver() - Helper macro for registering a pcmcia driver
- * @__pcmcia_driver: pcmcia_driver struct
- *
- * Helper macro for pcmcia drivers which do not do anything special in module
- * init/exit. This eliminates a lot of boilerplate. Each module may only use
- * this macro once, and calling it replaces module_init() and module_exit().
- */
-#define module_pcmcia_driver(__pcmcia_driver) \
-	module_driver(__pcmcia_driver, pcmcia_register_driver, \
-			pcmcia_unregister_driver)
-
-/*
- * backport of:
- * commit e5c5d22e8dcf7c2d430336cbf8e180bd38e8daf1
- * Author: Simon Horman <horms@verge.net.au>
- * Date:   Thu Mar 28 13:38:25 2013 +0900
- * 
- *     net: add ETH_P_802_3_MIN
- */
-#ifndef ETH_P_802_3_MIN
-#define ETH_P_802_3_MIN 0x0600
-#endif
-
-/*
- * backport of:
- * procfs: new helper - PDE_DATA(inode)
- */
-static inline void *PDE_DATA(const struct inode *inode)
-{
-	return PROC_I(inode)->pde->data;
-}
-
-/*
- * backport SOCK_SELECT_ERR_QUEUE -- see commit
- * "net: add option to enable error queue packets waking select"
- *
- * Adding 14 to SOCK_QUEUE_SHRUNK will reach a bet that can't be
- * set on older kernels, so sock_flag() will always return false.
- */
-#define SOCK_SELECT_ERR_QUEUE (SOCK_QUEUE_SHRUNK + 14)
-
-/*
- * DRM requires this, but we can't really backport it well
- */
-static inline void __iomem *pci_platform_rom(struct pci_dev *pdev, size_t *size)
-{
-	printk(KERN_WARNING "compat: not providing pci_platform_rom!\n");
-	return NULL;
-}
-
-/*
- * backport SOL_NFC -- see commit:
- * NFC: llcp: Implement socket options
- */
-#define SOL_NFC		280
-
-#else /* kernel is >= 3.10 */
-/*
- * We'd delete this upstream ever got this, we use our
- * backport_ prefix with LINUX_BACKPORT() so that if this
- * does get upstream we would not have to add another ifdef
- * here for the kernels in between v3.10.. up to the point
- * the routine would have gotten added, we'd just delete this
- * #else condition completely. If we didn't have this and
- * say 3.12 added the static inline upstream, we'd have a
- * clash on the backport for 3.12 as the routine would
- * already be defined *but* we'd need it for 3.11.
- */
-#define fb_enable_skip_vt_switch LINUX_BACKPORT(fb_enable_skip_vt_switch)
-static inline void fb_enable_skip_vt_switch(struct fb_info *info)
-{
-	info->skip_vt_switch = true;
-}
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)) */
-
-#endif /* LINUX_3_10_COMPAT_H */
diff --git a/backport/backport-include/linux/fb.h b/backport/backport-include/linux/fb.h
new file mode 100644
index 0000000..4522e25
--- /dev/null
+++ b/backport/backport-include/linux/fb.h
@@ -0,0 +1,48 @@
+#ifndef __BACKPORT_FB_H
+#define __BACKPORT_FB_H
+#include_next <linux/fb.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+/*
+ * This is a linux-next data structure element collateral evolution,
+ * we use a wrapper to avoid #ifdef hell to backport it. This allows
+ * us to use a simple fb_info_skip_vt_switch() replacement for when
+ * the new data structure element is used. If coccinelle SmPL grammar
+ * could be used to express the transformation for us on compat-drivers
+ * it means we'd need to express it only once. If the structure element
+ * collateral evolution were to be used *at development* time and we'd
+ * have a way to express the inverse through SmPL we'd be able to
+ * backport this collateral evolution automatically for any new driver
+ * that used it. We'd use coccinelle to look for it and do the
+ * transformations for us based on the original commit (maybe SmPL
+ * would be listed on the commit log.
+ *
+ * We may need the LINUX_BACKPORT() call that adds the backport_
+ * prefix for older kernels than 3.10 if distros decide to
+ * add this same static inline themselves (although unlikely).
+ */
+#define fb_enable_skip_vt_switch LINUX_BACKPORT(fb_enable_skip_vt_switch)
+static inline void fb_enable_skip_vt_switch(struct fb_info *info)
+{
+}
+#else /* kernel is >= 3.10 */
+/*
+ * We'd delete this upstream ever got this, we use our
+ * backport_ prefix with LINUX_BACKPORT() so that if this
+ * does get upstream we would not have to add another ifdef
+ * here for the kernels in between v3.10.. up to the point
+ * the routine would have gotten added, we'd just delete this
+ * #else condition completely. If we didn't have this and
+ * say 3.12 added the static inline upstream, we'd have a
+ * clash on the backport for 3.12 as the routine would
+ * already be defined *but* we'd need it for 3.11.
+ */
+#define fb_enable_skip_vt_switch LINUX_BACKPORT(fb_enable_skip_vt_switch)
+static inline void fb_enable_skip_vt_switch(struct fb_info *info)
+{
+	info->skip_vt_switch = true;
+}
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) */
+
+#endif /* __BACKPORT_FB_H */
diff --git a/backport/backport-include/linux/if_ether.h b/backport/backport-include/linux/if_ether.h
new file mode 100644
index 0000000..a3c6e45
--- /dev/null
+++ b/backport/backport-include/linux/if_ether.h
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_IF_ETHER_H
+#define __BACKPORT_IF_ETHER_H
+#include_next <linux/if_ether.h>
+
+/*
+ * backport of:
+ * commit e5c5d22e8dcf7c2d430336cbf8e180bd38e8daf1
+ * Author: Simon Horman <horms@verge.net.au>
+ * Date:   Thu Mar 28 13:38:25 2013 +0900
+ * 
+ *     net: add ETH_P_802_3_MIN
+ */
+#ifndef ETH_P_802_3_MIN
+#define ETH_P_802_3_MIN 0x0600
+#endif
+
+#endif /* __BACKPORT_IF_ETHER_H */
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
new file mode 100644
index 0000000..d8410a4
--- /dev/null
+++ b/backport/backport-include/linux/pci.h
@@ -0,0 +1,17 @@
+#ifndef _BACKPORT_LINUX_PCI_H
+#define _BACKPORT_LINUX_PCI_H
+#include_next <linux/pci.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+/*
+ * DRM requires this, but we can't really backport it well
+ */
+static inline void __iomem *pci_platform_rom(struct pci_dev *pdev, size_t *size)
+{
+	printk(KERN_WARNING "compat: not providing pci_platform_rom!\n");
+	return NULL;
+}
+#endif
+
+#endif /* _BACKPORT_LINUX_PCI_H */
diff --git a/backport/backport-include/linux/proc_fs.h b/backport/backport-include/linux/proc_fs.h
new file mode 100644
index 0000000..5a1bec1
--- /dev/null
+++ b/backport/backport-include/linux/proc_fs.h
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_PROC_FS_H
+#define __BACKPORT_PROC_FS_H
+#include_next <linux/proc_fs.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+/*
+ * backport of:
+ * procfs: new helper - PDE_DATA(inode)
+ */
+static inline void *PDE_DATA(const struct inode *inode)
+{
+	return PROC_I(inode)->pde->data;
+}
+#endif
+
+#endif /* __BACKPORT_PROC_FS_H */
diff --git a/backport/backport-include/linux/scatterlist.h b/backport/backport-include/linux/scatterlist.h
index aaa7371..66bce16 100644
--- a/backport/backport-include/linux/scatterlist.h
+++ b/backport/backport-include/linux/scatterlist.h
@@ -48,4 +48,28 @@ void __sg_page_iter_start(struct sg_page_iter *piter,
 #endif /* for_each_sg_page assumption */
 #endif /* version < 3.9 */
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
+
+#define sg_page_iter_page LINUX_BACKPORT(sg_page_iter_page)
+/**
+ * sg_page_iter_page - get the current page held by the page iterator
+ * @piter:     page iterator holding the page
+ */
+static inline struct page *sg_page_iter_page(struct sg_page_iter *piter)
+{
+	return nth_page(sg_page(piter->sg), piter->sg_pgoffset);
+}
+
+#define sg_page_iter_dma_address LINUX_BACKPORT(sg_page_iter_dma_address)
+/**
+ * sg_page_iter_dma_address - get the dma address of the current page held by
+ * the page iterator.
+ * @piter:     page iterator holding the page
+ */
+static inline dma_addr_t sg_page_iter_dma_address(struct sg_page_iter *piter)
+{
+	return sg_dma_address(piter->sg) + (piter->sg_pgoffset << PAGE_SHIFT);
+}
+#endif /* version < 3.10 */
+
 #endif /* __BACKPORT_SCATTERLIST_H */
diff --git a/backport/backport-include/linux/socket.h b/backport/backport-include/linux/socket.h
new file mode 100644
index 0000000..4187af2
--- /dev/null
+++ b/backport/backport-include/linux/socket.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_SOCKET_H
+#define __BACKPORT_SOCKET_H
+#include_next <linux/socket.h>
+
+#ifndef SOL_NFC
+/*
+ * backport SOL_NFC -- see commit:
+ * NFC: llcp: Implement socket options
+ */
+#define SOL_NFC		280
+#endif
+
+#endif /* __BACKPORT_SOCKET_H */
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
index c9ec1fc..ec67b9e 100644
--- a/backport/backport-include/net/sock.h
+++ b/backport/backport-include/net/sock.h
@@ -27,4 +27,15 @@
 
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+/*
+ * backport SOCK_SELECT_ERR_QUEUE -- see commit
+ * "net: add option to enable error queue packets waking select"
+ *
+ * Adding 14 to SOCK_QUEUE_SHRUNK will reach a bet that can't be
+ * set on older kernels, so sock_flag() will always return false.
+ */
+#define SOCK_SELECT_ERR_QUEUE (SOCK_QUEUE_SHRUNK + 14)
+#endif
+
 #endif /* __BACKPORT_NET_SOCK_H */
diff --git a/backport/backport-include/pcmcia/ds.h b/backport/backport-include/pcmcia/ds.h
new file mode 100644
index 0000000..45ab33a
--- /dev/null
+++ b/backport/backport-include/pcmcia/ds.h
@@ -0,0 +1,29 @@
+#ifndef __BACKPORT_PCMCIA_DS_H
+#define __BACKPORT_PCMCIA_DS_H
+#include_next <pcmcia/ds.h>
+
+#ifndef module_pcmcia_driver
+/**
+ * backport of:
+ *
+ * commit 6ed7ffddcf61f668114edb676417e5fb33773b59
+ * Author: H Hartley Sweeten <hsweeten@visionengravers.com>
+ * Date:   Wed Mar 6 11:24:44 2013 -0700
+ *
+ *     pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate
+ */
+
+/**
+ * module_pcmcia_driver() - Helper macro for registering a pcmcia driver
+ * @__pcmcia_driver: pcmcia_driver struct
+ *
+ * Helper macro for pcmcia drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only use
+ * this macro once, and calling it replaces module_init() and module_exit().
+ */
+#define module_pcmcia_driver(__pcmcia_driver) \
+	module_driver(__pcmcia_driver, pcmcia_register_driver, \
+			pcmcia_unregister_driver)
+#endif
+
+#endif /* __BACKPORT_PCMCIA_DS_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 10/42] backports: dissolve compat-2.6.25.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (8 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 09/42] backports: dissolve compat-3.10.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 11/42] backports: dissolve compat-3.8.h Johannes Berg
                   ` (34 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/asm-generic/bug.h        |   9 +
 backport/backport-include/backport/backport.h      |   1 -
 .../backport-include/linux/byteorder/generic.h     |  52 ++++
 backport/backport-include/linux/compat-2.6.25.h    | 314 ---------------------
 backport/backport-include/linux/compat-2.6.28.h    |  16 --
 backport/backport-include/linux/device.h           |   9 +
 backport/backport-include/linux/in.h               |  75 +++++
 backport/backport-include/linux/init.h             |  19 ++
 backport/backport-include/linux/input.h            |   9 +
 backport/backport-include/linux/kernel.h           |  17 ++
 backport/backport-include/linux/netdevice.h        |  13 +
 backport/backport-include/linux/pci.h              |   9 +
 backport/backport-include/linux/pm.h               |   9 +
 backport/backport-include/linux/pm_qos.h           |  45 +++
 backport/backport-include/linux/pm_qos_params.h    |   3 +-
 backport/backport-include/linux/scatterlist.h      |  28 ++
 backport/backport-include/linux/types.h            |  35 +++
 backport/compat/main.c                             |   1 +
 18 files changed, 331 insertions(+), 333 deletions(-)
 create mode 100644 backport/backport-include/asm-generic/bug.h
 create mode 100644 backport/backport-include/linux/byteorder/generic.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.25.h
 create mode 100644 backport/backport-include/linux/in.h
 create mode 100644 backport/backport-include/linux/init.h
 create mode 100644 backport/backport-include/linux/input.h
 create mode 100644 backport/backport-include/linux/kernel.h
 create mode 100644 backport/backport-include/linux/netdevice.h
 create mode 100644 backport/backport-include/linux/pm.h
 create mode 100644 backport/backport-include/linux/types.h

diff --git a/backport/backport-include/asm-generic/bug.h b/backport/backport-include/asm-generic/bug.h
new file mode 100644
index 0000000..86d683c
--- /dev/null
+++ b/backport/backport-include/asm-generic/bug.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_ASM_GENERIC_BUG_H
+#define __BACKPORT_ASM_GENERIC_BUG_H
+#include_next <asm-generic/bug.h>
+
+#ifndef __WARN
+#define __WARN(foo) dump_stack()
+#endif
+
+#endif /* __BACKPORT_ASM_GENERIC_BUG_H */
diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index a50e488..2c86774 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -56,7 +56,6 @@ void backport_dependency_symbol(void);
  * code introduced for *that* kernel revision.
  */
 
-#include <linux/compat-2.6.25.h>
 #include <linux/compat-2.6.26.h>
 #include <linux/compat-2.6.27.h>
 #include <linux/compat-2.6.28.h>
diff --git a/backport/backport-include/linux/byteorder/generic.h b/backport/backport-include/linux/byteorder/generic.h
new file mode 100644
index 0000000..005a92f
--- /dev/null
+++ b/backport/backport-include/linux/byteorder/generic.h
@@ -0,0 +1,52 @@
+#ifndef __BACKPORT_BYTEORDER_GENERIC_H
+#define __BACKPORT_BYTEORDER_GENERIC_H
+#include_next <linux/byteorder/generic.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+/* The patch:
+ * commit 8b5f6883683c91ad7e1af32b7ceeb604d68e2865
+ * Author: Marcin Slusarz <marcin.slusarz@gmail.com>
+ * Date:   Fri Feb 8 04:20:12 2008 -0800
+ *
+ *     byteorder: move le32_add_cpu & friends from OCFS2 to core
+ *
+ * moves le*_add_cpu and be*_add_cpu functions from OCFS2 to core
+ * header (1st) and converted some existing code to it. We port
+ * it here as later kernels will most likely use it.
+ */
+static inline void le16_add_cpu(__le16 *var, u16 val)
+{
+	*var = cpu_to_le16(le16_to_cpu(*var) + val);
+}
+
+static inline void le32_add_cpu(__le32 *var, u32 val)
+{
+	*var = cpu_to_le32(le32_to_cpu(*var) + val);
+}
+
+static inline void le64_add_cpu(__le64 *var, u64 val)
+{
+	*var = cpu_to_le64(le64_to_cpu(*var) + val);
+}
+
+static inline void be16_add_cpu(__be16 *var, u16 val)
+{
+	u16 v = be16_to_cpu(*var);
+	*var = cpu_to_be16(v + val);
+}
+
+static inline void be32_add_cpu(__be32 *var, u32 val)
+{
+	u32 v = be32_to_cpu(*var);
+	*var = cpu_to_be32(v + val);
+}
+
+static inline void be64_add_cpu(__be64 *var, u64 val)
+{
+	u64 v = be64_to_cpu(*var);
+	*var = cpu_to_be64(v + val);
+}
+#endif
+
+#endif /* __BACKPORT_BYTEORDER_GENERIC_H */
diff --git a/backport/backport-include/linux/compat-2.6.25.h b/backport/backport-include/linux/compat-2.6.25.h
deleted file mode 100644
index 9a2afdb..0000000
--- a/backport/backport-include/linux/compat-2.6.25.h
+++ /dev/null
@@ -1,314 +0,0 @@
-#ifndef LINUX_26_25_COMPAT_H
-#define LINUX_26_25_COMPAT_H
-
-#include <linux/version.h>
-
-/* Compat work for 2.6.24 */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
-
-#include <linux/types.h>
-#include <linux/io.h>
-#include <linux/hw_random.h>
-#include <linux/leds.h>
-#include <linux/kernel.h>
-#include <linux/netdevice.h>
-#include <linux/pm.h>
-#include <asm-generic/bug.h>
-#include <linux/pm_qos_params.h>
-#include <linux/pci.h>
-#include <linux/in.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/scatterlist.h>
-
-struct sg_table {
-	struct scatterlist *sgl;        /* the list */
-	unsigned int nents;             /* number of mapped entries */
-	unsigned int orig_nents;        /* original size of list */
-};
-
-#define sg_alloc_fn LINUX_BACKPORT(sg_alloc_fn)
-typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t);
-
-#define sg_free_fn LINUX_BACKPORT(sg_free_fn)
-typedef void (sg_free_fn)(struct scatterlist *, unsigned int);
-
-#define __sg_free_table LINUX_BACKPORT(__sg_free_table)
-void __sg_free_table(struct sg_table *table, unsigned int max_ents,
-		     sg_free_fn *free_fn);
-#define sg_free_table LINUX_BACKPORT(sg_free_table)
-void sg_free_table(struct sg_table *);
-#define __sg_alloc_table LINUX_BACKPORT(__sg_alloc_table)
-int __sg_alloc_table(struct sg_table *table, unsigned int nents,
-		     unsigned int max_ents, gfp_t gfp_mask,
-		     sg_alloc_fn *alloc_fn);
-#define sg_alloc_table LINUX_BACKPORT(sg_alloc_table)
-int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask);
-
-/*
- * Maximum number of entries that will be allocated in one piece, if
- * a list larger than this is required then chaining will be utilized.
- */
-#define SG_MAX_SINGLE_ALLOC            (PAGE_SIZE / sizeof(struct scatterlist))
-
-
-/* Backports b718989da7 */
-#define pci_enable_device_mem LINUX_BACKPORT(pci_enable_device_mem)
-int __must_check pci_enable_device_mem(struct pci_dev *dev);
-
-/*
- * Backports 312b1485fb509c9bc32eda28ad29537896658cb8
- * Author: Sam Ravnborg <sam@ravnborg.org>
- * Date:   Mon Jan 28 20:21:15 2008 +0100
- * 
- * Introduce new section reference annotations tags: __ref, __refdata, __refconst
- */
-#define __ref		__init_refok
-#define __refdata	__initdata_refok
-
-/*
- * backports 2658fa803111dae1353602e7f586de8e537803e2
- */
-
-static inline bool ipv4_is_loopback(__be32 addr)
-{
-	return (addr & htonl(0xff000000)) == htonl(0x7f000000);
-}
-
-static inline bool ipv4_is_multicast(__be32 addr)
-{
-	return (addr & htonl(0xf0000000)) == htonl(0xe0000000);
-}
-
-static inline bool ipv4_is_local_multicast(__be32 addr)
-{
-	return (addr & htonl(0xffffff00)) == htonl(0xe0000000);
-}
-
-static inline bool ipv4_is_lbcast(__be32 addr)
-{
-	/* limited broadcast */
-	return addr == htonl(INADDR_BROADCAST);
-}
-
-static inline bool ipv4_is_zeronet(__be32 addr)
-{
-	return (addr & htonl(0xff000000)) == htonl(0x00000000);
-}
-
-/* Special-Use IPv4 Addresses (RFC3330) */
-
-static inline bool ipv4_is_private_10(__be32 addr)
-{
-	return (addr & htonl(0xff000000)) == htonl(0x0a000000);
-}
-
-static inline bool ipv4_is_private_172(__be32 addr)
-{
-	return (addr & htonl(0xfff00000)) == htonl(0xac100000);
-}
-
-static inline bool ipv4_is_private_192(__be32 addr)
-{
-	return (addr & htonl(0xffff0000)) == htonl(0xc0a80000);
-}
-
-static inline bool ipv4_is_linklocal_169(__be32 addr)
-{
-	return (addr & htonl(0xffff0000)) == htonl(0xa9fe0000);
-}
-
-static inline bool ipv4_is_anycast_6to4(__be32 addr)
-{
-	return (addr & htonl(0xffffff00)) == htonl(0xc0586300);
-}
-
-static inline bool ipv4_is_test_192(__be32 addr)
-{
-	return (addr & htonl(0xffffff00)) == htonl(0xc0000200);
-}
-
-static inline bool ipv4_is_test_198(__be32 addr)
-{
-	return (addr & htonl(0xfffe0000)) == htonl(0xc6120000);
-}
-
-/*
- * phys_addr_t was added as a generic arch typedef on 2.6.28,
- * that backport is dealt with in compat-2.6.28.h
- */
-#if defined(CONFIG_X86) || defined(CONFIG_X86_64)
-
-#if defined(CONFIG_64BIT) || defined(CONFIG_X86_PAE) || defined(CONFIG_PHYS_64BIT)
-typedef u64 phys_addr_t;
-#else
-typedef u32 phys_addr_t;
-#endif
-
-#endif /* x86 */
-
-/* The macro below uses a const upstream, this differs */
-
-/**
- * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table
- * @_table: device table name
- *
- * This macro is used to create a struct pci_device_id array (a device table)
- * in a generic manner.
- */
-#define DEFINE_PCI_DEVICE_TABLE(_table) \
-	const struct pci_device_id _table[] __devinitdata
-
-/*
- * Backport work for QoS dependencies (kernel/pm_qos_params.c)
- * pm-qos stuff written by mark gross mgross@linux.intel.com.
- *
- * ipw2100 now makes use of:
- *
- * pm_qos_add_requirement(),
- * pm_qos_update_requirement() and
- * pm_qos_remove_requirement() from it
- *
- * mac80211 uses the network latency to determine if to enable or not
- * dynamic PS. mac80211 also and registers a notifier for when
- * the latency changes. Since older kernels do no thave pm-qos stuff
- * we just implement it completley here and register it upon cfg80211
- * init. I haven't tested ipw2100 on 2.6.24 though.
- *
- * This pm-qos implementation is copied verbatim from the kernel
- * written by mark gross mgross@linux.intel.com. You don't have
- * to do anythinig to use pm-qos except use the same exported
- * routines as used in newer kernels. The backport_pm_qos_power_init()
- * defned below is used by the compat module to initialize pm-qos.
- */
-int backport_pm_qos_power_init(void);
-int backport_pm_qos_power_deinit(void);
-
-/*
- * 2.6.25 adds PM_EVENT_HIBERNATE as well here but
- * we don't have this on <= 2.6.23)
- */
-#ifndef PM_EVENT_SLEEP /* some distribution have mucked with their own headers to add this.. */
-#define PM_EVENT_SLEEP  (PM_EVENT_SUSPEND)
-#endif
-
-/* Although we don't care about wimax this is needed for rfkill input stuff */
-#define KEY_WIMAX		246
-
-/* Although pm_qos stuff is not implemented on <= 2.6.24 lets keep the define */
-#define PM_QOS_DEFAULT_VALUE -1
-
-#define __WARN(foo) dump_stack()
-
-#define dev_emerg(dev, format, arg...)          \
-	dev_printk(KERN_EMERG , dev , format , ## arg)
-#define dev_alert(dev, format, arg...)          \
-	dev_printk(KERN_ALERT , dev , format , ## arg)
-#define dev_crit(dev, format, arg...)           \
-	dev_printk(KERN_CRIT , dev , format , ## arg)
-
-#define __dev_addr_sync LINUX_BACKPORT(__dev_addr_sync)
-extern int		__dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
-#define __dev_addr_unsync LINUX_BACKPORT(__dev_addr_unsync)
-extern void		__dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
-
-#define seq_file_net &init_net;
-
-enum nf_inet_hooks {
-	NF_INET_PRE_ROUTING = 0,
-	NF_INET_LOCAL_IN = 1,
-	NF_INET_FORWARD = 2,
-	NF_INET_LOCAL_OUT = 3,
-	NF_INET_POST_ROUTING = 4,
-	NF_INET_NUMHOOKS = 5
-};
-
-/* The patch:
- * commit 8b5f6883683c91ad7e1af32b7ceeb604d68e2865
- * Author: Marcin Slusarz <marcin.slusarz@gmail.com>
- * Date:   Fri Feb 8 04:20:12 2008 -0800
- *
- *     byteorder: move le32_add_cpu & friends from OCFS2 to core
- *
- * moves le*_add_cpu and be*_add_cpu functions from OCFS2 to core
- * header (1st) and converted some existing code to it. We port
- * it here as later kernels will most likely use it.
- */
-static inline void le16_add_cpu(__le16 *var, u16 val)
-{
-	*var = cpu_to_le16(le16_to_cpu(*var) + val);
-}
-
-static inline void le32_add_cpu(__le32 *var, u32 val)
-{
-	*var = cpu_to_le32(le32_to_cpu(*var) + val);
-}
-
-static inline void le64_add_cpu(__le64 *var, u64 val)
-{
-	*var = cpu_to_le64(le64_to_cpu(*var) + val);
-}
-
-static inline void be16_add_cpu(__be16 *var, u16 val)
-{
-	u16 v = be16_to_cpu(*var);
-	*var = cpu_to_be16(v + val);
-}
-
-static inline void be32_add_cpu(__be32 *var, u32 val)
-{
-	u32 v = be32_to_cpu(*var);
-	*var = cpu_to_be32(v + val);
-}
-
-static inline void be64_add_cpu(__be64 *var, u64 val)
-{
-	u64 v = be64_to_cpu(*var);
-	*var = cpu_to_be64(v + val);
-}
-
-/* 2.6.25 changes hwrng_unregister()'s behaviour by supporting
- * suspend of its parent device (the misc device, which is itself the
- * hardware random number generator). It does this by passing a parameter to
- * unregister_miscdev() which is not supported in older kernels. The suspend
- * parameter allows us to enable access to the device's hardware
- * number generator during suspend. As far as wireless is concerned this means
- * if a driver goes to suspend it you won't have the HNR available in
- * older kernels. */
-static inline void __hwrng_unregister(struct hwrng *rng, bool suspended)
-{
-	hwrng_unregister(rng);
-}
-
-static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
-{
-	led_classdev_unregister(lcd);
-}
-
-/**
- * The following things are out of ./include/linux/kernel.h
- * The new iwlwifi driver is using them.
- */
-#define strict_strtoul LINUX_BACKPORT(strict_strtoul)
-extern int strict_strtoul(const char *, unsigned int, unsigned long *);
-#define strict_strtol LINUX_BACKPORT(strict_strtol)
-extern int strict_strtol(const char *, unsigned int, long *);
-
-#else
-/*
- * Kernels >= 2.6.25 have pm-qos and its initialized as part of
- * the bootup process
- */
-static inline int backport_pm_qos_power_init(void)
-{
-	return 0;
-}
-
-static inline int backport_pm_qos_power_deinit(void)
-{
-	return 0;
-}
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) */
-
-#endif /* LINUX_26_25_COMPAT_H */
diff --git a/backport/backport-include/linux/compat-2.6.28.h b/backport/backport-include/linux/compat-2.6.28.h
index 3b5f3ea..611065b 100644
--- a/backport/backport-include/linux/compat-2.6.28.h
+++ b/backport/backport-include/linux/compat-2.6.28.h
@@ -44,22 +44,6 @@ extern struct platform_device *platform_device_register_data(struct device *,
 
 typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } compat_cpumask_t;
 
-#if defined(CONFIG_X86) || defined(CONFIG_X86_64) || defined(CONFIG_PPC)
-/*
- * CONFIG_PHYS_ADDR_T_64BIT was added as new to all architectures
- * as of 2.6.28 but x86 and ppc had it already. x86 only got phys_addr_t
- * as of 2.6.25 but then is backported in compat-2.6.25.h
- */
-#else
-#if defined(CONFIG_64BIT) || defined(CONFIG_X86_PAE) || defned(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
-#define CONFIG_PHYS_ADDR_T_64BIT 1
-typedef u64 phys_addr_t;
-#else
-typedef u32 phys_addr_t;
-#endif
-
-#endif /* non x86 and ppc */
-
 #ifndef WARN_ONCE
 #define WARN_ONCE(condition, format...) ({                      \
 	static int __warned;                                    \
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index e10360b..2851dae 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -5,6 +5,15 @@
 
 #include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#define dev_emerg(dev, format, arg...)          \
+	dev_printk(KERN_EMERG , dev , format , ## arg)
+#define dev_alert(dev, format, arg...)          \
+	dev_printk(KERN_ALERT , dev , format , ## arg)
+#define dev_crit(dev, format, arg...)           \
+	dev_printk(KERN_CRIT , dev , format , ## arg)
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
 #define devm_ioremap_resource LINUX_BACKPORT(devm_ioremap_resource)
 void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
diff --git a/backport/backport-include/linux/in.h b/backport/backport-include/linux/in.h
new file mode 100644
index 0000000..5cca155
--- /dev/null
+++ b/backport/backport-include/linux/in.h
@@ -0,0 +1,75 @@
+#ifndef __BACKPORT_IN_H
+#define __BACKPORT_IN_H
+#include_next <linux/in.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+/*
+ * backports 2658fa803111dae1353602e7f586de8e537803e2
+ */
+
+static inline bool ipv4_is_loopback(__be32 addr)
+{
+	return (addr & htonl(0xff000000)) == htonl(0x7f000000);
+}
+
+static inline bool ipv4_is_multicast(__be32 addr)
+{
+	return (addr & htonl(0xf0000000)) == htonl(0xe0000000);
+}
+
+static inline bool ipv4_is_local_multicast(__be32 addr)
+{
+	return (addr & htonl(0xffffff00)) == htonl(0xe0000000);
+}
+
+static inline bool ipv4_is_lbcast(__be32 addr)
+{
+	/* limited broadcast */
+	return addr == htonl(INADDR_BROADCAST);
+}
+
+static inline bool ipv4_is_zeronet(__be32 addr)
+{
+	return (addr & htonl(0xff000000)) == htonl(0x00000000);
+}
+
+/* Special-Use IPv4 Addresses (RFC3330) */
+
+static inline bool ipv4_is_private_10(__be32 addr)
+{
+	return (addr & htonl(0xff000000)) == htonl(0x0a000000);
+}
+
+static inline bool ipv4_is_private_172(__be32 addr)
+{
+	return (addr & htonl(0xfff00000)) == htonl(0xac100000);
+}
+
+static inline bool ipv4_is_private_192(__be32 addr)
+{
+	return (addr & htonl(0xffff0000)) == htonl(0xc0a80000);
+}
+
+static inline bool ipv4_is_linklocal_169(__be32 addr)
+{
+	return (addr & htonl(0xffff0000)) == htonl(0xa9fe0000);
+}
+
+static inline bool ipv4_is_anycast_6to4(__be32 addr)
+{
+	return (addr & htonl(0xffffff00)) == htonl(0xc0586300);
+}
+
+static inline bool ipv4_is_test_192(__be32 addr)
+{
+	return (addr & htonl(0xffffff00)) == htonl(0xc0000200);
+}
+
+static inline bool ipv4_is_test_198(__be32 addr)
+{
+	return (addr & htonl(0xfffe0000)) == htonl(0xc6120000);
+}
+#endif
+
+#endif /* __BACKPORT_IN_H */
diff --git a/backport/backport-include/linux/init.h b/backport/backport-include/linux/init.h
new file mode 100644
index 0000000..a835e33
--- /dev/null
+++ b/backport/backport-include/linux/init.h
@@ -0,0 +1,19 @@
+#ifndef __BACKPORT_INIT_H
+#define __BACKPORT_INIT_H
+#include_next <linux/init.h>
+
+/*
+ * Backports 312b1485fb509c9bc32eda28ad29537896658cb8
+ * Author: Sam Ravnborg <sam@ravnborg.org>
+ * Date:   Mon Jan 28 20:21:15 2008 +0100
+ * 
+ * Introduce new section reference annotations tags: __ref, __refdata, __refconst
+ */
+#ifndef __ref
+#define __ref		__init_refok
+#endif
+#ifndef __refdata
+#define __refdata	__initdata_refok
+#endif
+
+#endif /* __BACKPORT_INIT_H */
diff --git a/backport/backport-include/linux/input.h b/backport/backport-include/linux/input.h
new file mode 100644
index 0000000..588b4f6
--- /dev/null
+++ b/backport/backport-include/linux/input.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_INPUT_H
+#define __BACKPORT_INPUT_H
+#include_next <linux/input.h>
+
+#ifndef KEY_WIMAX
+#define KEY_WIMAX		246
+#endif
+
+#endif /* __BACKPORT_INPUT_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
new file mode 100644
index 0000000..499f538
--- /dev/null
+++ b/backport/backport-include/linux/kernel.h
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_KERNEL_H
+#define __BACKPORT_KERNEL_H
+#include_next <linux/kernel.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
+/**
+ * The following things are out of ./include/linux/kernel.h
+ * The new iwlwifi driver is using them.
+ */
+#define strict_strtoul LINUX_BACKPORT(strict_strtoul)
+extern int strict_strtoul(const char *, unsigned int, unsigned long *);
+#define strict_strtol LINUX_BACKPORT(strict_strtol)
+extern int strict_strtol(const char *, unsigned int, long *);
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) */
+
+#endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
new file mode 100644
index 0000000..0b83dc4
--- /dev/null
+++ b/backport/backport-include/linux/netdevice.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_NETDEVICE_H
+#define __BACKPORT_NETDEVICE_H
+#include_next <linux/netdevice.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#define __dev_addr_sync LINUX_BACKPORT(__dev_addr_sync)
+extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
+#define __dev_addr_unsync LINUX_BACKPORT(__dev_addr_unsync)
+extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
+#endif
+
+#endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index d8410a4..3ddbc25 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -3,6 +3,15 @@
 #include_next <linux/pci.h>
 #include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+/* Backports b718989da7 */
+#define pci_enable_device_mem LINUX_BACKPORT(pci_enable_device_mem)
+int __must_check pci_enable_device_mem(struct pci_dev *dev);
+
+#define DEFINE_PCI_DEVICE_TABLE(_table) \
+	const struct pci_device_id _table[] __devinitdata
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
 /*
  * DRM requires this, but we can't really backport it well
diff --git a/backport/backport-include/linux/pm.h b/backport/backport-include/linux/pm.h
new file mode 100644
index 0000000..5040949
--- /dev/null
+++ b/backport/backport-include/linux/pm.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_PM_H
+#define __BACKPORT_PM_H
+#include_next <linux/pm.h>
+
+#ifndef PM_EVENT_SLEEP
+#define PM_EVENT_SLEEP  (PM_EVENT_SUSPEND)
+#endif
+
+#endif /* __BACKPORT_PM_H */
diff --git a/backport/backport-include/linux/pm_qos.h b/backport/backport-include/linux/pm_qos.h
index c58c1c1..806a20f 100644
--- a/backport/backport-include/linux/pm_qos.h
+++ b/backport/backport-include/linux/pm_qos.h
@@ -3,10 +3,55 @@
 
 #include <linux/version.h>
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
+/*
+ * Kernels >= 2.6.25 have pm-qos and its initialized as part of
+ * the bootup process
+ */
+static inline int backport_pm_qos_power_init(void)
+{
+	return 0;
+}
+
+static inline int backport_pm_qos_power_deinit(void)
+{
+	return 0;
+}
+#else
+/*
+ * Backport work for QoS dependencies (kernel/pm_qos_params.c)
+ * pm-qos stuff written by mark gross mgross@linux.intel.com.
+ *
+ * ipw2100 now makes use of:
+ *
+ * pm_qos_add_requirement(),
+ * pm_qos_update_requirement() and
+ * pm_qos_remove_requirement() from it
+ *
+ * mac80211 uses the network latency to determine if to enable or not
+ * dynamic PS. mac80211 also and registers a notifier for when
+ * the latency changes. Since older kernels do no thave pm-qos stuff
+ * we just implement it completley here and register it upon cfg80211
+ * init. I haven't tested ipw2100 on 2.6.24 though.
+ *
+ * This pm-qos implementation is copied verbatim from the kernel
+ * written by mark gross mgross@linux.intel.com. You don't have
+ * to do anythinig to use pm-qos except use the same exported
+ * routines as used in newer kernels. The backport_pm_qos_power_init()
+ * defned below is used by the compat module to initialize pm-qos.
+ */
+int backport_pm_qos_power_init(void);
+int backport_pm_qos_power_deinit(void);
+#endif
+
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
 #include_next <linux/pm_qos.h>
 #else
 #include <linux/pm_qos_params.h>
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
 
+#ifndef PM_QOS_DEFAULT_VALUE
+#define PM_QOS_DEFAULT_VALUE -1
+#endif
+
 #endif	/* _COMPAT_LINUX_PM_QOS_H */
diff --git a/backport/backport-include/linux/pm_qos_params.h b/backport/backport-include/linux/pm_qos_params.h
index 4c8c89e..c591753 100644
--- a/backport/backport-include/linux/pm_qos_params.h
+++ b/backport/backport-include/linux/pm_qos_params.h
@@ -1,7 +1,6 @@
-#include <linux/version.h>
-
 #ifndef __COMPAT_LINUX_PM_QOS_PARAMS_H
 #define __COMPAT_LINUX_PM_QOS_PARAMS_H
+#include <linux/version.h>
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
 #include_next <linux/pm_qos_params.h>
diff --git a/backport/backport-include/linux/scatterlist.h b/backport/backport-include/linux/scatterlist.h
index 66bce16..678b03c 100644
--- a/backport/backport-include/linux/scatterlist.h
+++ b/backport/backport-include/linux/scatterlist.h
@@ -3,6 +3,34 @@
 #include_next <linux/scatterlist.h>
 #include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+struct sg_table {
+	struct scatterlist *sgl;        /* the list */
+	unsigned int nents;             /* number of mapped entries */
+	unsigned int orig_nents;        /* original size of list */
+};
+
+#define sg_alloc_fn LINUX_BACKPORT(sg_alloc_fn)
+typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t);
+
+#define sg_free_fn LINUX_BACKPORT(sg_free_fn)
+typedef void (sg_free_fn)(struct scatterlist *, unsigned int);
+
+#define __sg_free_table LINUX_BACKPORT(__sg_free_table)
+void __sg_free_table(struct sg_table *table, unsigned int max_ents,
+		     sg_free_fn *free_fn);
+#define sg_free_table LINUX_BACKPORT(sg_free_table)
+void sg_free_table(struct sg_table *);
+#define __sg_alloc_table LINUX_BACKPORT(__sg_alloc_table)
+int __sg_alloc_table(struct sg_table *table, unsigned int nents,
+		     unsigned int max_ents, gfp_t gfp_mask,
+		     sg_alloc_fn *alloc_fn);
+#define sg_alloc_table LINUX_BACKPORT(sg_alloc_table)
+int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask);
+
+#define SG_MAX_SINGLE_ALLOC            (PAGE_SIZE / sizeof(struct scatterlist))
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
 
 /* Lets expect distributions might backport this */
diff --git a/backport/backport-include/linux/types.h b/backport/backport-include/linux/types.h
new file mode 100644
index 0000000..b787df6
--- /dev/null
+++ b/backport/backport-include/linux/types.h
@@ -0,0 +1,35 @@
+#ifndef __BACKPORT_TYPES_H
+#define __BACKPORT_TYPES_H
+#include_next <linux/types.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#if defined(CONFIG_X86) || defined(CONFIG_X86_64)
+
+#if defined(CONFIG_64BIT) || defined(CONFIG_X86_PAE) || defined(CONFIG_PHYS_64BIT)
+typedef u64 phys_addr_t;
+#else
+typedef u32 phys_addr_t;
+#endif
+
+#endif /* x86 */
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) /* < 2.6.25 */
+
+#if defined(CONFIG_X86) || defined(CONFIG_X86_64) || defined(CONFIG_PPC)
+/*
+ * CONFIG_PHYS_ADDR_T_64BIT was added as new to all architectures
+ * as of 2.6.28 but x86 and ppc had it already.
+ */
+#else
+#if defined(CONFIG_64BIT) || defined(CONFIG_X86_PAE) || defned(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
+#define CONFIG_PHYS_ADDR_T_64BIT 1
+typedef u64 phys_addr_t;
+#else
+typedef u32 phys_addr_t;
+#endif
+
+#endif /* non x86 and ppc */
+
+#endif /* < 2.6.28 */
+
+#endif /* __BACKPORT_TYPES_H */
diff --git a/backport/compat/main.c b/backport/compat/main.c
index 7818d73..9607209 100644
--- a/backport/compat/main.c
+++ b/backport/compat/main.c
@@ -1,4 +1,5 @@
 #include <linux/module.h>
+#include <linux/pm_qos.h>
 #include "compat-2.6.34.h"
 
 MODULE_AUTHOR("Luis R. Rodriguez");
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 11/42] backports: dissolve compat-3.8.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (9 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 10/42] backports: dissolve compat-2.6.25.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 12/42] backports: dissolve compat-3.7.h Johannes Berg
                   ` (33 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/backport/backport.h     |   1 -
 backport/backport-include/linux/compat-3.8.h      | 131 ----------------------
 backport/backport-include/linux/efi.h             |  66 +++++++++++
 backport/backport-include/linux/hid.h             |  11 ++
 backport/backport-include/linux/kref.h            |  22 ++++
 backport/backport-include/linux/mod_devicetable.h |  13 +++
 backport/backport-include/linux/netdevice.h       |   9 ++
 backport/backport-include/linux/pci_regs.h        |  29 +++++
 backport/backport-include/linux/random.h          |  13 +++
 9 files changed, 163 insertions(+), 132 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-3.8.h
 create mode 100644 backport/backport-include/linux/efi.h
 create mode 100644 backport/backport-include/linux/hid.h
 create mode 100644 backport/backport-include/linux/kref.h
 create mode 100644 backport/backport-include/linux/mod_devicetable.h
 create mode 100644 backport/backport-include/linux/pci_regs.h
 create mode 100644 backport/backport-include/linux/random.h

diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index 2c86774..d8b2464 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -78,7 +78,6 @@ void backport_dependency_symbol(void);
 #include <linux/compat-3.5.h>
 #include <linux/compat-3.6.h>
 #include <linux/compat-3.7.h>
-#include <linux/compat-3.8.h>
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/backport/backport-include/linux/compat-3.8.h b/backport/backport-include/linux/compat-3.8.h
deleted file mode 100644
index 55fdc16..0000000
--- a/backport/backport-include/linux/compat-3.8.h
+++ /dev/null
@@ -1,131 +0,0 @@
-#ifndef LINUX_3_8_COMPAT_H
-#define LINUX_3_8_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
-
-#include <linux/hid.h>
-#include <linux/netdevice.h>
-#include <linux/efi.h>
-#include <linux/random.h>
-
-/* backports 496f2f9 */
-#define prandom_seed(_seed)		srandom32(_seed)
-#define prandom_u32()			random32()
-#define prandom_u32_state(_state)	prandom32(_state)
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,8))
-#define netdev_set_default_ethtool_ops LINUX_BACKPORT(netdev_set_default_ethtool_ops)
-extern void netdev_set_default_ethtool_ops(struct net_device *dev,
-					   const struct ethtool_ops *ops);
-#endif
-
-#define HID_BUS_ANY                            0xffff
-#define HID_GROUP_ANY                          0x0000
-
-#define  PCI_EXP_LNKCTL_ASPM_L0S  0x01 /* L0s Enable */
-#define  PCI_EXP_LNKCTL_ASPM_L1   0x02 /* L1 Enable */
-
-#define hid_ignore LINUX_BACKPORT(hid_ignore)
-extern bool hid_ignore(struct hid_device *);
-
-/* This backports:
- *
- * commit 4b20db3de8dab005b07c74161cb041db8c5ff3a7
- * Author: Thomas Hellstrom <thellstrom@vmware.com>
- * Date:   Tue Nov 6 11:31:49 2012 +0000
- *
- *	kref: Implement kref_get_unless_zero v3
- */
-/**
- * kref_get_unless_zero - Increment refcount for object unless it is zero.
- * @kref: object.
- *
- * Return non-zero if the increment succeeded. Otherwise return 0.
- *
- * This function is intended to simplify locking around refcounting for
- * objects that can be looked up from a lookup structure, and which are
- * removed from that lookup structure in the object destructor.
- * Operations on such objects require at least a read lock around
- * lookup + kref_get, and a write lock around kref_put + remove from lookup
- * structure. Furthermore, RCU implementations become extremely tricky.
- * With a lookup followed by a kref_get_unless_zero *with return value check*
- * locking in the kref_put path can be deferred to the actual removal from
- * the lookup structure and RCU lookups become trivial.
- */
-static inline int __must_check kref_get_unless_zero(struct kref *kref)
-{
-	return atomic_add_unless(&kref->refcount, 1, 0);
-}
-
-/* This backports:
- *
- * commit 83e68189745ad931c2afd45d8ee3303929233e7f
- * Author: Matt Fleming <matt.fleming@intel.com>
- * Date:   Wed Nov 14 09:42:35 2012 +0000
- *
- *     efi: Make 'efi_enabled' a function to query EFI facilities
- *
- */
-/* check first if this was already backported */
-#ifndef EFI_BOOT
-/*
- * We play games with efi_enabled so that the compiler will, if
- * possible, remove EFI-related code altogether.
- */
-#define EFI_BOOT		0	/* Were we booted from EFI? */
-#define EFI_SYSTEM_TABLES	1	/* Can we use EFI system tables? */
-#define EFI_CONFIG_TABLES	2	/* Can we use EFI config tables? */
-#define EFI_RUNTIME_SERVICES	3	/* Can we use runtime services? */
-#define EFI_MEMMAP		4	/* Can we use EFI memory map? */
-#define EFI_64BIT		5	/* Is the firmware 64-bit? */
-
-#ifdef CONFIG_EFI
-# ifdef CONFIG_X86
-static inline int compat_efi_enabled(int facility)
-{
-	switch (facility) {
-	case EFI_BOOT:
-		return efi_enabled;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
-	case EFI_64BIT:
-		return efi_64bit;
-#endif
-	default:
-		printk(KERN_ERR "can not translate efi_enabled() to old values completly\n");
-		return efi_enabled;
-	}
-}
-# else
-static inline int compat_efi_enabled(int facility)
-{
-	return 1;
-}
-# endif
-#else
-static inline int compat_efi_enabled(int facility)
-{
-	return 0;
-}
-#endif
-#ifdef efi_enabled
-#undef efi_enabled
-#endif
-#define efi_enabled(facility) compat_efi_enabled(facility)
-#endif /* EFI_BOOT */
-
-/* This backports:
- *
- * commit 130f1b8f35f14d27c43da755f3c9226318c17f57
- * Author: Bjorn Helgaas <bhelgaas@google.com>
- * Date:   Wed Dec 26 10:39:23 2012 -0700
- *
- *     PCI: Add PCIe Link Capability link speed and width names
- */
-#define  PCI_EXP_LNKCAP_SLS_2_5GB 0x1	/* LNKCAP2 SLS Vector bit 0 (2.5GT/s) */
-#define  PCI_EXP_LNKCAP_SLS_5_0GB 0x2	/* LNKCAP2 SLS Vector bit 1 (5.0GT/s) */
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) */
-
-#endif /* LINUX_3_8_COMPAT_H */
diff --git a/backport/backport-include/linux/efi.h b/backport/backport-include/linux/efi.h
new file mode 100644
index 0000000..2fc40e5
--- /dev/null
+++ b/backport/backport-include/linux/efi.h
@@ -0,0 +1,66 @@
+#ifndef __BACKPORT_EFI_H
+#define __BACKPORT_EFI_H
+#include_next <linux/efi.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
+
+/* This backports:
+ *
+ * commit 83e68189745ad931c2afd45d8ee3303929233e7f
+ * Author: Matt Fleming <matt.fleming@intel.com>
+ * Date:   Wed Nov 14 09:42:35 2012 +0000
+ *
+ *     efi: Make 'efi_enabled' a function to query EFI facilities
+ *
+ */
+/* check first if this was already backported */
+#ifndef EFI_BOOT
+/*
+ * We play games with efi_enabled so that the compiler will, if
+ * possible, remove EFI-related code altogether.
+ */
+#define EFI_BOOT		0	/* Were we booted from EFI? */
+#define EFI_SYSTEM_TABLES	1	/* Can we use EFI system tables? */
+#define EFI_CONFIG_TABLES	2	/* Can we use EFI config tables? */
+#define EFI_RUNTIME_SERVICES	3	/* Can we use runtime services? */
+#define EFI_MEMMAP		4	/* Can we use EFI memory map? */
+#define EFI_64BIT		5	/* Is the firmware 64-bit? */
+
+#ifdef CONFIG_EFI
+# ifdef CONFIG_X86
+static inline int compat_efi_enabled(int facility)
+{
+	switch (facility) {
+	case EFI_BOOT:
+		return efi_enabled;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+	case EFI_64BIT:
+		return efi_64bit;
+#endif
+	default:
+		printk(KERN_ERR "can not translate efi_enabled() to old values completly\n");
+		return efi_enabled;
+	}
+}
+# else
+static inline int compat_efi_enabled(int facility)
+{
+	return 1;
+}
+# endif
+#else
+static inline int compat_efi_enabled(int facility)
+{
+	return 0;
+}
+#endif
+#ifdef efi_enabled
+#undef efi_enabled
+#endif
+#define efi_enabled(facility) compat_efi_enabled(facility)
+#endif /* EFI_BOOT */
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) */
+
+#endif /* __BACKPORT_EFI_H */
diff --git a/backport/backport-include/linux/hid.h b/backport/backport-include/linux/hid.h
new file mode 100644
index 0000000..bb7455f
--- /dev/null
+++ b/backport/backport-include/linux/hid.h
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_HID_H
+#define __BACKPORT_HID_H
+#include_next <linux/hid.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
+#define hid_ignore LINUX_BACKPORT(hid_ignore)
+extern bool hid_ignore(struct hid_device *);
+#endif
+
+#endif /* __BACKPORT_HID_H */
diff --git a/backport/backport-include/linux/kref.h b/backport/backport-include/linux/kref.h
new file mode 100644
index 0000000..40f3c77
--- /dev/null
+++ b/backport/backport-include/linux/kref.h
@@ -0,0 +1,22 @@
+#ifndef __BACKPORT_KREF_H
+#define __BACKPORT_KREF_H
+#include_next <linux/kref.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
+#include <linux/atomic.h>
+/* This backports:
+ *
+ * commit 4b20db3de8dab005b07c74161cb041db8c5ff3a7
+ * Author: Thomas Hellstrom <thellstrom@vmware.com>
+ * Date:   Tue Nov 6 11:31:49 2012 +0000
+ *
+ *	kref: Implement kref_get_unless_zero v3
+ */
+static inline int __must_check kref_get_unless_zero(struct kref *kref)
+{
+	return atomic_add_unless(&kref->refcount, 1, 0);
+}
+#endif
+
+#endif /* __BACKPORT_KREF_H */
diff --git a/backport/backport-include/linux/mod_devicetable.h b/backport/backport-include/linux/mod_devicetable.h
new file mode 100644
index 0000000..5ad4c06
--- /dev/null
+++ b/backport/backport-include/linux/mod_devicetable.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_MOD_DEVICETABLE_H
+#define __BACKPORT_MOD_DEVICETABLE_H
+#include_next <linux/mod_devicetable.h>
+
+#ifndef HID_BUS_ANY
+#define HID_BUS_ANY                            0xffff
+#endif
+
+#ifndef HID_GROUP_ANY
+#define HID_GROUP_ANY                          0x0000
+#endif
+
+#endif /* __BACKPORT_MOD_DEVICETABLE_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 0b83dc4..cf38903 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -3,6 +3,15 @@
 #include_next <linux/netdevice.h>
 #include <linux/version.h>
 
+/* older kernels don't include this here, we need it */
+#include <linux/ethtool.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
+#define netdev_set_default_ethtool_ops LINUX_BACKPORT(netdev_set_default_ethtool_ops)
+extern void netdev_set_default_ethtool_ops(struct net_device *dev,
+					   const struct ethtool_ops *ops);
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
 #define __dev_addr_sync LINUX_BACKPORT(__dev_addr_sync)
 extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
diff --git a/backport/backport-include/linux/pci_regs.h b/backport/backport-include/linux/pci_regs.h
new file mode 100644
index 0000000..ec8c59f
--- /dev/null
+++ b/backport/backport-include/linux/pci_regs.h
@@ -0,0 +1,29 @@
+#ifndef __BACKPORT_UAPI_PCI_REGS_H
+#define __BACKPORT_UAPI_PCI_REGS_H
+#include_next <linux/pci_regs.h>
+
+#ifndef PCI_EXP_LNKCTL_ASPM_L0S
+#define  PCI_EXP_LNKCTL_ASPM_L0S  0x01 /* L0s Enable */
+#endif
+
+#ifndef PCI_EXP_LNKCTL_ASPM_L1
+#define  PCI_EXP_LNKCTL_ASPM_L1   0x02 /* L1 Enable */
+#endif
+
+/* This backports:
+ *
+ * commit 130f1b8f35f14d27c43da755f3c9226318c17f57
+ * Author: Bjorn Helgaas <bhelgaas@google.com>
+ * Date:   Wed Dec 26 10:39:23 2012 -0700
+ *
+ *     PCI: Add PCIe Link Capability link speed and width names
+ */
+#ifndef PCI_EXP_LNKCAP_SLS_2_5GB
+#define  PCI_EXP_LNKCAP_SLS_2_5GB 0x1	/* LNKCAP2 SLS Vector bit 0 (2.5GT/s) */
+#endif
+
+#ifndef PCI_EXP_LNKCAP_SLS_5_0GB
+#define  PCI_EXP_LNKCAP_SLS_5_0GB 0x2	/* LNKCAP2 SLS Vector bit 1 (5.0GT/s) */
+#endif
+
+#endif /* __BACKPORT_UAPI_PCI_REGS_H */
diff --git a/backport/backport-include/linux/random.h b/backport/backport-include/linux/random.h
new file mode 100644
index 0000000..812ce7f
--- /dev/null
+++ b/backport/backport-include/linux/random.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_RANDOM_H
+#define __BACKPORT_RANDOM_H
+#include_next <linux/random.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
+/* backports 496f2f9 */
+#define prandom_seed(_seed)		srandom32(_seed)
+#define prandom_u32()			random32()
+#define prandom_u32_state(_state)	prandom32(_state)
+#endif
+
+#endif /* __BACKPORT_RANDOM_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 12/42] backports: dissolve compat-3.7.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (10 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 11/42] backports: dissolve compat-3.8.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 13/42] backports: dissolve compat-3.6.h Johannes Berg
                   ` (32 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/backport/backport.h     |   1 -
 backport/backport-include/linux/compat-3.7.h      | 218 ----------------------
 backport/backport-include/linux/etherdevice.h     |  22 +++
 backport/backport-include/linux/ioport.h          |   9 +
 backport/backport-include/linux/mm.h              |   9 +
 backport/backport-include/linux/netlink.h         |  15 ++
 backport/backport-include/linux/pci.h             |  41 ++++
 backport/backport-include/linux/pci_regs.h        |   4 +
 backport/backport-include/linux/platform_device.h |   8 +
 backport/backport-include/linux/seq_file.h        |  34 ++++
 backport/backport-include/linux/tty.h             |  14 ++
 backport/backport-include/linux/workqueue.h       |  12 ++
 backport/backport-include/net/genetlink.h         |  12 ++
 backport/backport-include/net/netlink.h           |  96 ++++++++++
 14 files changed, 276 insertions(+), 219 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-3.7.h
 create mode 100644 backport/backport-include/linux/etherdevice.h
 create mode 100644 backport/backport-include/linux/ioport.h
 create mode 100644 backport/backport-include/linux/mm.h
 create mode 100644 backport/backport-include/linux/netlink.h
 create mode 100644 backport/backport-include/linux/seq_file.h
 create mode 100644 backport/backport-include/linux/tty.h
 create mode 100644 backport/backport-include/linux/workqueue.h
 create mode 100644 backport/backport-include/net/genetlink.h
 create mode 100644 backport/backport-include/net/netlink.h

diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index d8b2464..e892279 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -77,7 +77,6 @@ void backport_dependency_symbol(void);
 #include <linux/compat-3.4.h>
 #include <linux/compat-3.5.h>
 #include <linux/compat-3.6.h>
-#include <linux/compat-3.7.h>
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/backport/backport-include/linux/compat-3.7.h b/backport/backport-include/linux/compat-3.7.h
deleted file mode 100644
index c7a4ebc..0000000
--- a/backport/backport-include/linux/compat-3.7.h
+++ /dev/null
@@ -1,218 +0,0 @@
-#ifndef LINUX_3_7_COMPAT_H
-#define LINUX_3_7_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
-
-#include <linux/workqueue.h>
-#include <linux/tty.h>
-#include <linux/pci.h>
-#include <linux/pci_regs.h>
-#include <linux/mm.h>
-#include <linux/user_namespace.h>
-#include <linux/file.h>
-#include <linux/seq_file.h>
-#include <net/netlink.h>
-
-#define VM_DONTDUMP    VM_NODUMP
-
-#define IORESOURCE_REG	0x00000300	/* Register offsets */
-
-#ifdef CONFIG_USER_NS
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38))
-static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
-{
-	struct file *f = container_of((void *) seq, struct file, private_data);
-
-	return f->f_cred->user_ns;
-}
-#else
-static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
-{
-	return current_user_ns();
-}
-#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) */
-
-#else
-static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
-{
-	extern struct user_namespace init_user_ns;
-	return &init_user_ns;
-}
-#endif /* CONFIG_USER_NS */
-
-#define netlink_notify_portid(__notify) (__notify->pid)
-#define genl_info_snd_portid(__genl_info) (__genl_info->snd_pid)
-#define NETLINK_CB_PORTID(__skb) NETLINK_CB(cb->skb).pid
-
-#define mod_delayed_work LINUX_BACKPORT(mod_delayed_work)
-bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
-		      unsigned long delay);
-
-/* Backports tty_lock: Localise the lock */
-#define tty_lock(__tty) tty_lock()
-#define tty_unlock(__tty) tty_unlock()
-
-#define tty_port_register_device(port, driver, index, device) \
-	tty_register_device(driver, index, device)
-
-#define pcie_capability_read_word LINUX_BACKPORT(pcie_capability_read_word)
-int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val);
-#define pcie_capability_read_dword LINUX_BACKPORT(pcie_capability_read_dword)
-int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val);
-#define pcie_capability_write_word LINUX_BACKPORT(pcie_capability_write_word)
-int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val);
-#define pcie_capability_write_dword LINUX_BACKPORT(pcie_capability_write_dword)
-int pcie_capability_write_dword(struct pci_dev *dev, int pos, u32 val);
-#define pcie_capability_clear_and_set_word LINUX_BACKPORT(pcie_capability_clear_and_set_word)
-int pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos,
-				       u16 clear, u16 set);
-#define pcie_capability_clear_and_set_dword LINUX_BACKPORT(pcie_capability_clear_and_set_dword)
-int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos,
-					u32 clear, u32 set);
-
-static inline int pcie_capability_set_word(struct pci_dev *dev, int pos,
-					   u16 set)
-{
-	return pcie_capability_clear_and_set_word(dev, pos, 0, set);
-}
-
-static inline int pcie_capability_set_dword(struct pci_dev *dev, int pos,
-					    u32 set)
-{
-	return pcie_capability_clear_and_set_dword(dev, pos, 0, set);
-}
-
-static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos,
-					     u16 clear)
-{
-	return pcie_capability_clear_and_set_word(dev, pos, clear, 0);
-}
-
-static inline int pcie_capability_clear_dword(struct pci_dev *dev, int pos,
-					      u32 clear)
-{
-	return pcie_capability_clear_and_set_dword(dev, pos, clear, 0);
-}
-
-#define PCI_EXP_LNKSTA2			50      /* Link Status 2 */
-
-/* This backports:
- *
- * commit 6d57e9078e880a3dd232d579f42ac437a8f1ef7b
- * Author: Duan Jiong <djduanjiong@gmail.com>
- * Date:   Sat Sep 8 16:32:28 2012 +0000
- * 
- *     etherdevice: introduce help function eth_zero_addr() 
- */
-/**
- * eth_zero_addr - Assign zero address
- * @addr: Pointer to a six-byte array containing the Ethernet address
- *
- * Assign the zero address to the given address array.
- */
-static inline void eth_zero_addr(u8 *addr)
-{
-	memset(addr, 0x00, ETH_ALEN);
-}
-
-/**
- * nla_put_s8 - Add a s8 netlink attribute to a socket buffer
- * @skb: socket buffer to add attribute to
- * @attrtype: attribute type
- * @value: numeric value
- */
-static inline int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value)
-{
-	return nla_put(skb, attrtype, sizeof(s8), &value);
-}
-
-/**
- * nla_put_s16 - Add a s16 netlink attribute to a socket buffer
- * @skb: socket buffer to add attribute to
- * @attrtype: attribute type
- * @value: numeric value
- */
-static inline int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value)
-{
-	return nla_put(skb, attrtype, sizeof(s16), &value);
-}
-
-/**
- * nla_put_s32 - Add a s32 netlink attribute to a socket buffer
- * @skb: socket buffer to add attribute to
- * @attrtype: attribute type
- * @value: numeric value
- */
-static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value)
-{
-	return nla_put(skb, attrtype, sizeof(s32), &value);
-}
-
-/**
- * nla_put_s64 - Add a s64 netlink attribute to a socket buffer
- * @skb: socket buffer to add attribute to
- * @attrtype: attribute type
- * @value: numeric value
- */
-static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value)
-{
-	return nla_put(skb, attrtype, sizeof(s64), &value);
-}
-
-/**
- * nla_get_s32 - return payload of s32 attribute
- * @nla: s32 netlink attribute
- */
-static inline s32 nla_get_s32(const struct nlattr *nla)
-{
-	return *(s32 *) nla_data(nla);
-}
-
-/**
- * nla_get_s16 - return payload of s16 attribute
- * @nla: s16 netlink attribute
- */
-static inline s16 nla_get_s16(const struct nlattr *nla)
-{
-	return *(s16 *) nla_data(nla);
-}
-
-/**
- * nla_get_s8 - return payload of s8 attribute
- * @nla: s8 netlink attribute
- */
-static inline s8 nla_get_s8(const struct nlattr *nla)
-{
-	return *(s8 *) nla_data(nla);
-}
-
-/**
- * nla_get_s64 - return payload of s64 attribute
- * @nla: s64 netlink attribute
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
-static inline s64 nla_get_s64(const struct nlattr *nla)
-#else
-static inline s64 nla_get_s64(struct nlattr *nla)
-#endif
-{
-	s64 tmp;
-
-	nla_memcpy(&tmp, nla, sizeof(tmp));
-
-	return tmp;
-}
-
-#define PLATFORM_DEVID_NONE	(-1)
-#define PLATFORM_DEVID_AUTO	(-1)
-
-#else /* (LINUX_VERSION_CODE > KERNEL_VERSION(3,7,0)) */
-#define netlink_notify_portid(__notify) (__notify->portid)
-#define genl_info_snd_portid(__genl_info) (__genl_info->snd_portid)
-#define NETLINK_CB_PORTID(__skb) NETLINK_CB(cb->skb).portid
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) */
-
-#endif /* LINUX_3_7_COMPAT_H */
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
new file mode 100644
index 0000000..8cedf49
--- /dev/null
+++ b/backport/backport-include/linux/etherdevice.h
@@ -0,0 +1,22 @@
+#ifndef _BACKPORT_LINUX_ETHERDEVICE_H
+#define _BACKPORT_LINUX_ETHERDEVICE_H
+#include_next <linux/etherdevice.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+
+/* This backports:
+ *
+ * commit 6d57e9078e880a3dd232d579f42ac437a8f1ef7b
+ * Author: Duan Jiong <djduanjiong@gmail.com>
+ * Date:   Sat Sep 8 16:32:28 2012 +0000
+ * 
+ *     etherdevice: introduce help function eth_zero_addr() 
+ */
+static inline void eth_zero_addr(u8 *addr)
+{
+	memset(addr, 0x00, ETH_ALEN);
+}
+#endif
+
+#endif /* _BACKPORT_LINUX_ETHERDEVICE_H */
diff --git a/backport/backport-include/linux/ioport.h b/backport/backport-include/linux/ioport.h
new file mode 100644
index 0000000..3424401
--- /dev/null
+++ b/backport/backport-include/linux/ioport.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_LINUX_IOPORT_H
+#define __BACKPORT_LINUX_IOPORT_H
+#include_next <linux/ioport.h>
+
+#ifndef IORESOURCE_REG
+#define IORESOURCE_REG		0x00000300
+#endif
+
+#endif /* __BACKPORT_LINUX_IOPORT_H */
diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
new file mode 100644
index 0000000..bfb771c
--- /dev/null
+++ b/backport/backport-include/linux/mm.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_MM_H
+#define __BACKPORT_MM_H
+#include_next <linux/mm.h>
+
+#ifndef VM_DONTDUMP
+#define VM_DONTDUMP    VM_NODUMP
+#endif
+
+#endif /* __BACKPORT_MM_H */
diff --git a/backport/backport-include/linux/netlink.h b/backport/backport-include/linux/netlink.h
new file mode 100644
index 0000000..2058a90
--- /dev/null
+++ b/backport/backport-include/linux/netlink.h
@@ -0,0 +1,15 @@
+#ifndef __BACKPORT_LINUX_NETLINK_H
+#define __BACKPORT_LINUX_NETLINK_H
+#include_next <linux/netlink.h>
+#include <linux/version.h>
+
+/* this is for patches we apply */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+#define netlink_notify_portid(__notify) (__notify->pid)
+#define NETLINK_CB_PORTID(__skb) NETLINK_CB(cb->skb).pid
+#else
+#define netlink_notify_portid(__notify) (__notify->portid)
+#define NETLINK_CB_PORTID(__skb) NETLINK_CB(cb->skb).portid
+#endif
+
+#endif /* __BACKPORT_LINUX_NETLINK_H */
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index 3ddbc25..58f539f 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -12,6 +12,47 @@ int __must_check pci_enable_device_mem(struct pci_dev *dev);
 	const struct pci_device_id _table[] __devinitdata
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+#define pcie_capability_read_word LINUX_BACKPORT(pcie_capability_read_word)
+int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val);
+#define pcie_capability_read_dword LINUX_BACKPORT(pcie_capability_read_dword)
+int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val);
+#define pcie_capability_write_word LINUX_BACKPORT(pcie_capability_write_word)
+int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val);
+#define pcie_capability_write_dword LINUX_BACKPORT(pcie_capability_write_dword)
+int pcie_capability_write_dword(struct pci_dev *dev, int pos, u32 val);
+#define pcie_capability_clear_and_set_word LINUX_BACKPORT(pcie_capability_clear_and_set_word)
+int pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos,
+				       u16 clear, u16 set);
+#define pcie_capability_clear_and_set_dword LINUX_BACKPORT(pcie_capability_clear_and_set_dword)
+int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos,
+					u32 clear, u32 set);
+
+static inline int pcie_capability_set_word(struct pci_dev *dev, int pos,
+					   u16 set)
+{
+	return pcie_capability_clear_and_set_word(dev, pos, 0, set);
+}
+
+static inline int pcie_capability_set_dword(struct pci_dev *dev, int pos,
+					    u32 set)
+{
+	return pcie_capability_clear_and_set_dword(dev, pos, 0, set);
+}
+
+static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos,
+					     u16 clear)
+{
+	return pcie_capability_clear_and_set_word(dev, pos, clear, 0);
+}
+
+static inline int pcie_capability_clear_dword(struct pci_dev *dev, int pos,
+					      u32 clear)
+{
+	return pcie_capability_clear_and_set_dword(dev, pos, clear, 0);
+}
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
 /*
  * DRM requires this, but we can't really backport it well
diff --git a/backport/backport-include/linux/pci_regs.h b/backport/backport-include/linux/pci_regs.h
index ec8c59f..dd13eb3 100644
--- a/backport/backport-include/linux/pci_regs.h
+++ b/backport/backport-include/linux/pci_regs.h
@@ -26,4 +26,8 @@
 #define  PCI_EXP_LNKCAP_SLS_5_0GB 0x2	/* LNKCAP2 SLS Vector bit 1 (5.0GT/s) */
 #endif
 
+#ifndef PCI_EXP_LNKSTA2
+#define PCI_EXP_LNKSTA2			50      /* Link Status 2 */
+#endif
+
 #endif /* __BACKPORT_UAPI_PCI_REGS_H */
diff --git a/backport/backport-include/linux/platform_device.h b/backport/backport-include/linux/platform_device.h
index acb4aba..f0d6f89 100644
--- a/backport/backport-include/linux/platform_device.h
+++ b/backport/backport-include/linux/platform_device.h
@@ -19,4 +19,12 @@ static void __exit __platform_driver##_exit(void) \
 module_exit(__platform_driver##_exit);
 #endif
 
+#ifndef PLATFORM_DEVID_NONE
+#define PLATFORM_DEVID_NONE	(-1)
+#endif
+
+#ifndef PLATFORM_DEVID_AUTO
+#define PLATFORM_DEVID_AUTO	(-1)
+#endif
+
 #endif /* __BACKPORT_PLATFORM_DEVICE_H */
diff --git a/backport/backport-include/linux/seq_file.h b/backport/backport-include/linux/seq_file.h
new file mode 100644
index 0000000..c407161
--- /dev/null
+++ b/backport/backport-include/linux/seq_file.h
@@ -0,0 +1,34 @@
+#ifndef __BACKPORT_SEQ_FILE_H
+#define __BACKPORT_SEQ_FILE_H
+#include_next <linux/seq_file.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+#include <linux/user_namespace.h>
+#include <linux/file.h>
+#include <linux/fs.h>
+#ifdef CONFIG_USER_NS
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)
+static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
+{
+	struct file *f = container_of((void *) seq, struct file, private_data);
+
+	return f->f_cred->user_ns;
+}
+#else
+static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
+{
+	return current_user_ns();
+}
+#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) */
+
+#else
+static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
+{
+	extern struct user_namespace init_user_ns;
+	return &init_user_ns;
+}
+#endif /* CONFIG_USER_NS */
+#endif /* < 3.7 */
+
+#endif /* __BACKPORT_SEQ_FILE_H */
diff --git a/backport/backport-include/linux/tty.h b/backport/backport-include/linux/tty.h
new file mode 100644
index 0000000..0424dc7
--- /dev/null
+++ b/backport/backport-include/linux/tty.h
@@ -0,0 +1,14 @@
+#ifndef __BACKPORT_LINUX_TTY_H
+#define __BACKPORT_LINUX_TTY_H
+#include_next <linux/tty.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+/* Backports tty_lock: Localise the lock */
+#define tty_lock(__tty) tty_lock()
+#define tty_unlock(__tty) tty_unlock()
+
+#define tty_port_register_device(port, driver, index, device) \
+	tty_register_device(driver, index, device)
+#endif
+
+#endif /* __BACKPORT_LINUX_TTY_H */
diff --git a/backport/backport-include/linux/workqueue.h b/backport/backport-include/linux/workqueue.h
new file mode 100644
index 0000000..6e9796f
--- /dev/null
+++ b/backport/backport-include/linux/workqueue.h
@@ -0,0 +1,12 @@
+#ifndef __BACKPORT_LINUX_WORKQUEUE_H
+#define __BACKPORT_LINUX_WORKQUEUE_H
+#include_next <linux/workqueue.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
+#define mod_delayed_work LINUX_BACKPORT(mod_delayed_work)
+bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
+		      unsigned long delay);
+#endif
+
+#endif /* __BACKPORT_LINUX_WORKQUEUE_H */
diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
new file mode 100644
index 0000000..9512549
--- /dev/null
+++ b/backport/backport-include/net/genetlink.h
@@ -0,0 +1,12 @@
+#ifndef __BACKPORT_NET_GENETLINK_H
+#define __BACKPORT_NET_GENETLINK_H
+#include_next <net/genetlink.h>
+
+/* this is for patches we apply */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+#define genl_info_snd_portid(__genl_info) (__genl_info->snd_pid)
+#else
+#define genl_info_snd_portid(__genl_info) (__genl_info->snd_portid)
+#endif
+
+#endif /* __BACKPORT_NET_GENETLINK_H */
diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
new file mode 100644
index 0000000..ee51de6
--- /dev/null
+++ b/backport/backport-include/net/netlink.h
@@ -0,0 +1,96 @@
+#ifndef __BACKPORT_NET_NETLINK_H
+#define __BACKPORT_NET_NETLINK_H
+#include_next <net/netlink.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+/**
+ * nla_put_s8 - Add a s8 netlink attribute to a socket buffer
+ * @skb: socket buffer to add attribute to
+ * @attrtype: attribute type
+ * @value: numeric value
+ */
+static inline int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value)
+{
+	return nla_put(skb, attrtype, sizeof(s8), &value);
+}
+
+/**
+ * nla_put_s16 - Add a s16 netlink attribute to a socket buffer
+ * @skb: socket buffer to add attribute to
+ * @attrtype: attribute type
+ * @value: numeric value
+ */
+static inline int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value)
+{
+	return nla_put(skb, attrtype, sizeof(s16), &value);
+}
+
+/**
+ * nla_put_s32 - Add a s32 netlink attribute to a socket buffer
+ * @skb: socket buffer to add attribute to
+ * @attrtype: attribute type
+ * @value: numeric value
+ */
+static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value)
+{
+	return nla_put(skb, attrtype, sizeof(s32), &value);
+}
+
+/**
+ * nla_put_s64 - Add a s64 netlink attribute to a socket buffer
+ * @skb: socket buffer to add attribute to
+ * @attrtype: attribute type
+ * @value: numeric value
+ */
+static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value)
+{
+	return nla_put(skb, attrtype, sizeof(s64), &value);
+}
+
+/**
+ * nla_get_s32 - return payload of s32 attribute
+ * @nla: s32 netlink attribute
+ */
+static inline s32 nla_get_s32(const struct nlattr *nla)
+{
+	return *(s32 *) nla_data(nla);
+}
+
+/**
+ * nla_get_s16 - return payload of s16 attribute
+ * @nla: s16 netlink attribute
+ */
+static inline s16 nla_get_s16(const struct nlattr *nla)
+{
+	return *(s16 *) nla_data(nla);
+}
+
+/**
+ * nla_get_s8 - return payload of s8 attribute
+ * @nla: s8 netlink attribute
+ */
+static inline s8 nla_get_s8(const struct nlattr *nla)
+{
+	return *(s8 *) nla_data(nla);
+}
+
+/**
+ * nla_get_s64 - return payload of s64 attribute
+ * @nla: s64 netlink attribute
+ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+static inline s64 nla_get_s64(const struct nlattr *nla)
+#else
+static inline s64 nla_get_s64(struct nlattr *nla)
+#endif
+{
+	s64 tmp;
+
+	nla_memcpy(&tmp, nla, sizeof(tmp));
+
+	return tmp;
+}
+#endif /* < 3.7.0 */
+
+#endif /* __BACKPORT_NET_NETLINK_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 13/42] backports: dissolve compat-3.6.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (11 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 12/42] backports: dissolve compat-3.7.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 14/42] backports: dissolve compat-3.5.h Johannes Berg
                   ` (31 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 .../asm-generic/dma-mapping-common.h               |  25 ++++
 backport/backport-include/backport/backport.h      |   1 -
 backport/backport-include/linux/compat-3.6.h       | 139 ---------------------
 backport/backport-include/linux/etherdevice.h      |  28 +++++
 backport/backport-include/linux/i2c.h              |  15 +++
 backport/backport-include/linux/leds.h             |  29 +++++
 backport/backport-include/linux/pci_regs.h         |  34 +++++
 backport/backport-include/linux/scatterlist.h      |   9 ++
 backport/backport-include/linux/string.h           |  11 ++
 backport/backport-include/linux/usb.h              |  27 ++++
 backport/backport-include/net/genetlink.h          |   4 +
 11 files changed, 182 insertions(+), 140 deletions(-)
 create mode 100644 backport/backport-include/asm-generic/dma-mapping-common.h
 delete mode 100644 backport/backport-include/linux/compat-3.6.h
 create mode 100644 backport/backport-include/linux/i2c.h
 create mode 100644 backport/backport-include/linux/leds.h
 create mode 100644 backport/backport-include/linux/string.h
 create mode 100644 backport/backport-include/linux/usb.h

diff --git a/backport/backport-include/asm-generic/dma-mapping-common.h b/backport/backport-include/asm-generic/dma-mapping-common.h
new file mode 100644
index 0000000..ed2fe61
--- /dev/null
+++ b/backport/backport-include/asm-generic/dma-mapping-common.h
@@ -0,0 +1,25 @@
+#ifndef __BACKPORT_ASM_GENERIC_DMA_MAPPING_COMMON_H
+#define __BACKPORT_ASM_GENERIC_DMA_MAPPING_COMMON_H
+#include_next <asm-generic/dma-mapping-common.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
+
+#define dma_common_get_sgtable LINUX_BACKPORT(dma_common_get_sgtable)
+int
+dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
+		       void *cpu_addr, dma_addr_t dma_addr, size_t size);
+
+#define dma_get_sgtable_attrs LINUX_BACKPORT(dma_get_sgtable_attrs)
+struct dma_attrs;
+static inline int
+dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, void *cpu_addr,
+		      dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs)
+{
+	return dma_common_get_sgtable(dev, sgt, cpu_addr, dma_addr, size);
+}
+
+#define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, NULL)
+#endif
+
+#endif /* __BACKPORT_ASM_GENERIC_DMA_MAPPING_COMMON_H */
diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index e892279..c5c194e 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -76,7 +76,6 @@ void backport_dependency_symbol(void);
 #include <linux/compat-3.3.h>
 #include <linux/compat-3.4.h>
 #include <linux/compat-3.5.h>
-#include <linux/compat-3.6.h>
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/backport/backport-include/linux/compat-3.6.h b/backport/backport-include/linux/compat-3.6.h
deleted file mode 100644
index 770a333..0000000
--- a/backport/backport-include/linux/compat-3.6.h
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef LINUX_3_6_COMPAT_H
-#define LINUX_3_6_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
-
-#include <linux/scatterlist.h>
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-#include <linux/i2c.h>
-#include <linux/dma-attrs.h>
-/* Unlocked flavor */
-#define __i2c_transfer LINUX_BACKPORT(__i2c_transfer)
-extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
-			  int num);
-#endif
-
-
-#define memweight LINUX_BACKPORT(memweight)
-extern size_t memweight(const void *ptr, size_t bytes);
-
-/* backports efc42bc9 */
-#define sg_alloc_table_from_pages LINUX_BACKPORT(sg_alloc_table_from_pages)
-int sg_alloc_table_from_pages(struct sg_table *sgt,
-			      struct page **pages, unsigned int n_pages,
-			      unsigned long offset, unsigned long size,
-			      gfp_t gfp_mask);
-
-#define dma_common_get_sgtable LINUX_BACKPORT(dma_common_get_sgtable)
-int
-dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
-		       void *cpu_addr, dma_addr_t dma_addr, size_t size);
-
-#define dma_get_sgtable_attrs LINUX_BACKPORT(dma_get_sgtable_attrs)
-struct dma_attrs;
-static inline int
-dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, void *cpu_addr,
-		      dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs)
-{
-	return dma_common_get_sgtable(dev, sgt, cpu_addr, dma_addr, size);
-}
-
-#define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, NULL)
-
-
-/**
- * Backports
- *
- * commit d81a5d1956731c453b85c141458d4ff5d6cc5366
- * Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
- * Date:   Tue Jul 10 19:10:06 2012 -0300
- *
- * 	USB: add USB_VENDOR_AND_INTERFACE_INFO() macro
- */
-#include <linux/usb.h>
-#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
-       .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
-               | USB_DEVICE_ID_MATCH_VENDOR, \
-       .idVendor = (vend), \
-       .bInterfaceClass = (cl), \
-       .bInterfaceSubClass = (sc), \
-       .bInterfaceProtocol = (pr)
-
-/**
- * Backports
- *
- * commit cdcac9cd7741af2c2b9255cbf060f772596907bb
- * Author: Dave Airlie <airlied@redhat.com>
- * Date:   Wed Jun 27 08:35:52 2012 +0100
- *
- * 	pci_regs: define LNKSTA2 pcie cap + bits.
- *
- * 	We need these for detecting the max link speed for drm drivers.
- *
- * 	Acked-by: Bjorn Helgaas <bhelgass@google.com>
- * 	Signed-off-by: Dave Airlie <airlied@redhat.com>
- */
-
-#define  PCI_EXP_LNKCAP2 		44	/* Link Capability 2 */
-#define  PCI_EXP_LNKCAP2_SLS_2_5GB 	0x01	/* Current Link Speed 2.5GT/s */
-#define  PCI_EXP_LNKCAP2_SLS_5_0GB 	0x02	/* Current Link Speed 5.0GT/s */
-#define  PCI_EXP_LNKCAP2_SLS_8_0GB 	0x04	/* Current Link Speed 8.0GT/s */
-#define  PCI_EXP_LNKCAP2_CROSSLINK 	0x100 /* Crosslink supported */
-
-#include <net/genetlink.h>
-#include <linux/etherdevice.h>
-
-/**
- * eth_broadcast_addr - Assign broadcast address
- * @addr: Pointer to a six-byte array containing the Ethernet address
- *
- * Assign the broadcast address to the given address array.
- */
-static inline void eth_broadcast_addr(u8 *addr)
-{
-	memset(addr, 0xff, ETH_ALEN);
-}
-
-/**
- * eth_random_addr - Generate software assigned random Ethernet address
- * @addr: Pointer to a six-byte array containing the Ethernet address
- *
- * Generate a random Ethernet address (MAC) that is not multicast
- * and has the local assigned bit set.
- */
-static inline void eth_random_addr(u8 *addr)
-{
-	get_random_bytes(addr, ETH_ALEN);
-	addr[0] &= 0xfe;        /* clear multicast bit */
-	addr[0] |= 0x02;        /* set local assignment bit (IEEE802) */
-}
-
-#define GENLMSG_DEFAULT_SIZE (NLMSG_DEFAULT_SIZE - GENL_HDRLEN)
-
-/*
- * Backports 
- * 
- * commit 959d62fa865d2e616b61a509e1cc5b88741f065e
- * Author: Shuah Khan <shuahkhan@gmail.com>
- * Date:   Thu Jun 14 04:34:30 2012 +0800
- *
- *   leds: Rename led_brightness_set() to led_set_brightness()
- *   
- *   Rename leds external interface led_brightness_set() to led_set_brightness().
- *   This is the second phase of the change to reduce confusion between the
- *   leds internal and external interfaces that set brightness. With this change,
- *   now the external interface is led_set_brightness(). The first phase renamed
- *   the internal interface led_set_brightness() to __led_set_brightness().
- *   There are no changes to the interface implementations.
- *   
- *   Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
- *   Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
- */
-#define led_set_brightness(_dev, _switch) led_brightness_set(_dev, _switch)
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) */
-
-#endif /* LINUX_3_6_COMPAT_H */
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index 8cedf49..1246be4 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -3,6 +3,34 @@
 #include_next <linux/etherdevice.h>
 #include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
+#include <linux/random.h>
+/**
+ * eth_broadcast_addr - Assign broadcast address
+ * @addr: Pointer to a six-byte array containing the Ethernet address
+ *
+ * Assign the broadcast address to the given address array.
+ */
+static inline void eth_broadcast_addr(u8 *addr)
+{
+	memset(addr, 0xff, ETH_ALEN);
+}
+
+/**
+ * eth_random_addr - Generate software assigned random Ethernet address
+ * @addr: Pointer to a six-byte array containing the Ethernet address
+ *
+ * Generate a random Ethernet address (MAC) that is not multicast
+ * and has the local assigned bit set.
+ */
+static inline void eth_random_addr(u8 *addr)
+{
+	get_random_bytes(addr, ETH_ALEN);
+	addr[0] &= 0xfe;        /* clear multicast bit */
+	addr[0] |= 0x02;        /* set local assignment bit (IEEE802) */
+}
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
 
 /* This backports:
diff --git a/backport/backport-include/linux/i2c.h b/backport/backport-include/linux/i2c.h
new file mode 100644
index 0000000..5b87732
--- /dev/null
+++ b/backport/backport-include/linux/i2c.h
@@ -0,0 +1,15 @@
+#ifndef __BACKPORT_LINUX_I2C_H
+#define __BACKPORT_LINUX_I2C_H
+#include_next <linux/i2c.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) && \
+    LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
+#include <linux/i2c.h>
+/* Unlocked flavor */
+#define __i2c_transfer LINUX_BACKPORT(__i2c_transfer)
+extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+			  int num);
+#endif
+
+#endif /* __BACKPORT_LINUX_I2C_H */
diff --git a/backport/backport-include/linux/leds.h b/backport/backport-include/linux/leds.h
new file mode 100644
index 0000000..17fc89e
--- /dev/null
+++ b/backport/backport-include/linux/leds.h
@@ -0,0 +1,29 @@
+#ifndef __BACKPORT_LINUX_LEDS_H
+#define __BACKPORT_LINUX_LEDS_H
+#include_next <linux/leds.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
+/*
+ * Backports 
+ * 
+ * commit 959d62fa865d2e616b61a509e1cc5b88741f065e
+ * Author: Shuah Khan <shuahkhan@gmail.com>
+ * Date:   Thu Jun 14 04:34:30 2012 +0800
+ *
+ *   leds: Rename led_brightness_set() to led_set_brightness()
+ *   
+ *   Rename leds external interface led_brightness_set() to led_set_brightness().
+ *   This is the second phase of the change to reduce confusion between the
+ *   leds internal and external interfaces that set brightness. With this change,
+ *   now the external interface is led_set_brightness(). The first phase renamed
+ *   the internal interface led_set_brightness() to __led_set_brightness().
+ *   There are no changes to the interface implementations.
+ *   
+ *   Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
+ *   Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
+ */
+#define led_set_brightness(_dev, _switch) led_brightness_set(_dev, _switch)
+#endif
+
+#endif /* __BACKPORT_LINUX_LEDS_H */
diff --git a/backport/backport-include/linux/pci_regs.h b/backport/backport-include/linux/pci_regs.h
index dd13eb3..f479236 100644
--- a/backport/backport-include/linux/pci_regs.h
+++ b/backport/backport-include/linux/pci_regs.h
@@ -30,4 +30,38 @@
 #define PCI_EXP_LNKSTA2			50      /* Link Status 2 */
 #endif
 
+/**
+ * Backports
+ *
+ * commit cdcac9cd7741af2c2b9255cbf060f772596907bb
+ * Author: Dave Airlie <airlied@redhat.com>
+ * Date:   Wed Jun 27 08:35:52 2012 +0100
+ *
+ * 	pci_regs: define LNKSTA2 pcie cap + bits.
+ *
+ * 	We need these for detecting the max link speed for drm drivers.
+ *
+ * 	Acked-by: Bjorn Helgaas <bhelgass@google.com>
+ * 	Signed-off-by: Dave Airlie <airlied@redhat.com>
+ */
+#ifndef PCI_EXP_LNKCAP2
+#define  PCI_EXP_LNKCAP2 		44	/* Link Capability 2 */
+#endif
+
+#ifndef PCI_EXP_LNKCAP2_SLS_2_5GB
+#define  PCI_EXP_LNKCAP2_SLS_2_5GB 	0x01	/* Current Link Speed 2.5GT/s */
+#endif
+
+#ifndef PCI_EXP_LNKCAP2_SLS_5_0GB
+#define  PCI_EXP_LNKCAP2_SLS_5_0GB 	0x02	/* Current Link Speed 5.0GT/s */
+#endif
+
+#ifndef PCI_EXP_LNKCAP2_SLS_8_0GB
+#define  PCI_EXP_LNKCAP2_SLS_8_0GB 	0x04	/* Current Link Speed 8.0GT/s */
+#endif
+
+#ifndef PCI_EXP_LNKCAP2_CROSSLINK
+#define  PCI_EXP_LNKCAP2_CROSSLINK 	0x100 /* Crosslink supported */
+#endif
+
 #endif /* __BACKPORT_UAPI_PCI_REGS_H */
diff --git a/backport/backport-include/linux/scatterlist.h b/backport/backport-include/linux/scatterlist.h
index 678b03c..448730f 100644
--- a/backport/backport-include/linux/scatterlist.h
+++ b/backport/backport-include/linux/scatterlist.h
@@ -31,6 +31,15 @@ int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask);
 #define SG_MAX_SINGLE_ALLOC            (PAGE_SIZE / sizeof(struct scatterlist))
 #endif
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
+/* backports efc42bc9 */
+#define sg_alloc_table_from_pages LINUX_BACKPORT(sg_alloc_table_from_pages)
+int sg_alloc_table_from_pages(struct sg_table *sgt,
+			      struct page **pages, unsigned int n_pages,
+			      unsigned long offset, unsigned long size,
+			      gfp_t gfp_mask);
+#endif /* < 3.6 */
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
 
 /* Lets expect distributions might backport this */
diff --git a/backport/backport-include/linux/string.h b/backport/backport-include/linux/string.h
new file mode 100644
index 0000000..819d141
--- /dev/null
+++ b/backport/backport-include/linux/string.h
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_LINUX_STRING_H
+#define __BACKPORT_LINUX_STRING_H
+#include_next <linux/string.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
+#define memweight LINUX_BACKPORT(memweight)
+extern size_t memweight(const void *ptr, size_t bytes);
+#endif
+
+#endif /* __BACKPORT_LINUX_STRING_H */
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
new file mode 100644
index 0000000..e1ff8be
--- /dev/null
+++ b/backport/backport-include/linux/usb.h
@@ -0,0 +1,27 @@
+#ifndef __BACKPORT_USB_H
+#define __BACKPORT_USB_H
+
+#include_next <linux/usb.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
+/**
+ * Backports
+ *
+ * commit d81a5d1956731c453b85c141458d4ff5d6cc5366
+ * Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
+ * Date:   Tue Jul 10 19:10:06 2012 -0300
+ *
+ * 	USB: add USB_VENDOR_AND_INTERFACE_INFO() macro
+ */
+#include <linux/usb.h>
+#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
+       .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
+               | USB_DEVICE_ID_MATCH_VENDOR, \
+       .idVendor = (vend), \
+       .bInterfaceClass = (cl), \
+       .bInterfaceSubClass = (sc), \
+       .bInterfaceProtocol = (pr)
+#endif
+
+#endif /* __BACKPORT_USB_H */
diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index 9512549..44ffcaf 100644
--- a/backport/backport-include/net/genetlink.h
+++ b/backport/backport-include/net/genetlink.h
@@ -9,4 +9,8 @@
 #define genl_info_snd_portid(__genl_info) (__genl_info->snd_portid)
 #endif
 
+#ifndef GENLMSG_DEFAULT_SIZE
+#define GENLMSG_DEFAULT_SIZE (NLMSG_DEFAULT_SIZE - GENL_HDRLEN)
+#endif
+
 #endif /* __BACKPORT_NET_GENETLINK_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 14/42] backports: dissolve compat-3.5.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (12 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 13/42] backports: dissolve compat-3.6.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 15/42] backports: dissolve backport.h Johannes Berg
                   ` (30 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-3.5.h     | 378 -----------------------
 backport/backport-include/linux/device.h         |  44 +++
 backport/backport-include/linux/etherdevice.h    |   7 +
 backport/backport-include/linux/genetlink.h      |  18 ++
 backport/backport-include/linux/hrtimer.h        |  11 +
 backport/backport-include/linux/i2c.h            |  12 +
 backport/backport-include/linux/kernel.h         |  12 +
 backport/backport-include/linux/net.h            |  44 +++
 backport/backport-include/linux/pagemap.h        |  76 +++++
 backport/backport-include/linux/pkt_sched.h      | 106 +++++++
 backport/backport-include/linux/regmap.h         |  16 +
 backport/backport-include/linux/vga_switcheroo.h |  51 ++-
 backport/backport-include/net/netlink.h          |  26 ++
 13 files changed, 413 insertions(+), 388 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-3.5.h
 create mode 100644 backport/backport-include/linux/genetlink.h
 create mode 100644 backport/backport-include/linux/hrtimer.h
 create mode 100644 backport/backport-include/linux/net.h
 create mode 100644 backport/backport-include/linux/pagemap.h
 create mode 100644 backport/backport-include/linux/pkt_sched.h
 create mode 100644 backport/backport-include/linux/regmap.h

diff --git a/backport/backport-include/linux/compat-3.5.h b/backport/backport-include/linux/compat-3.5.h
deleted file mode 100644
index e21048d..0000000
--- a/backport/backport-include/linux/compat-3.5.h
+++ /dev/null
@@ -1,378 +0,0 @@
-#ifndef LINUX_3_5_COMPAT_H
-#define LINUX_3_5_COMPAT_H
-
-#include <linux/version.h>
-#include <linux/fs.h>
-#include <linux/etherdevice.h>
-#include <linux/net.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
-
-#include <net/netlink.h>
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-#include <linux/regmap.h>
-
-#define dev_get_regmap LINUX_BACKPORT(dev_get_regmap)
-static inline
-struct regmap *dev_get_regmap(struct device *dev, const char *name)
-{
-	return NULL;
-}
-
-#define devres_release LINUX_BACKPORT(devres_release)
-extern int devres_release(struct device *dev, dr_release_t release,
-			  dr_match_t match, void *match_data);
-#endif
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
-#include <linux/ratelimit.h>
-#define dev_level_ratelimited(dev_level, dev, fmt, ...)			\
-do {									\
-	static DEFINE_RATELIMIT_STATE(_rs,				\
-				      DEFAULT_RATELIMIT_INTERVAL,	\
-				      DEFAULT_RATELIMIT_BURST);		\
-	if (__ratelimit(&_rs))						\
-		dev_level(dev, fmt, ##__VA_ARGS__);			\
-} while (0)
-
-#define dev_emerg_ratelimited(dev, fmt, ...)				\
-	dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__)
-#define dev_alert_ratelimited(dev, fmt, ...)				\
-	dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__)
-
-
-#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
-#define dev_dbg_ratelimited(dev, fmt, ...)				\
-do {									\
-	static DEFINE_RATELIMIT_STATE(_rs,				\
-				      DEFAULT_RATELIMIT_INTERVAL,	\
-				      DEFAULT_RATELIMIT_BURST);		\
-	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);			\
-	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) &&	\
-	    __ratelimit(&_rs))						\
-		__dynamic_pr_debug(&descriptor, pr_fmt(fmt),		\
-				   ##__VA_ARGS__);			\
-} while (0)
-#else
-#define dev_dbg_ratelimited(dev, fmt, ...)			\
-	no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
-#endif
-
-#endif
-
-/*
- * This backports:
- * commit 569a8fc38367dfafd87454f27ac646c8e6b54bca
- * Author: David S. Miller <davem@davemloft.net>
- * Date:   Thu Mar 29 23:18:53 2012 -0400
- *
- *     netlink: Add nla_put_be{16,32,64}() helpers.
- */
-
-static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
-{
-	return nla_put(skb, attrtype, sizeof(__be16), &value);
-}
-
-static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
-{
-	return nla_put(skb, attrtype, sizeof(__be32), &value);
-}
-
-static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
-{
-	return nla_put(skb, attrtype, sizeof(__be64), &value);
-}
-
-/*
- * This backports:
- *
- * commit f56f821feb7b36223f309e0ec05986bb137ce418
- * Author: Daniel Vetter <daniel.vetter@ffwll.ch>
- * Date:   Sun Mar 25 19:47:41 2012 +0200
- *
- *     mm: extend prefault helpers to fault in more than PAGE_SIZE
- *
- * The new functions are used by drm/i915 driver.
- *
- */
-
-static inline int fault_in_multipages_writeable(char __user *uaddr, int size)
-{
-        int ret = 0;
-        char __user *end = uaddr + size - 1;
-
-        if (unlikely(size == 0))
-                return ret;
-
-        /*
-         * Writing zeroes into userspace here is OK, because we know that if
-         * the zero gets there, we'll be overwriting it.
-         */
-        while (uaddr <= end) {
-                ret = __put_user(0, uaddr);
-                if (ret != 0)
-                        return ret;
-                uaddr += PAGE_SIZE;
-        }
-
-        /* Check whether the range spilled into the next page. */
-        if (((unsigned long)uaddr & PAGE_MASK) ==
-                        ((unsigned long)end & PAGE_MASK))
-                ret = __put_user(0, end);
-
-        return ret;
-}
-
-static inline int fault_in_multipages_readable(const char __user *uaddr,
-                                               int size)
-{
-        volatile char c;
-        int ret = 0;
-        const char __user *end = uaddr + size - 1;
-
-        if (unlikely(size == 0))
-                return ret;
-
-        while (uaddr <= end) {
-                ret = __get_user(c, uaddr);
-                if (ret != 0)
-                        return ret;
-                uaddr += PAGE_SIZE;
-        }
-
-        /* Check whether the range spilled into the next page. */
-        if (((unsigned long)uaddr & PAGE_MASK) ==
-                        ((unsigned long)end & PAGE_MASK)) {
-                ret = __get_user(c, end);
-                (void)c;
-        }
-
-        return ret;
-}
-
-/* switcheroo is available on >= 2.6.34 */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
-#include <linux/vga_switcheroo.h>
-/*
- * This backports:
- *
- *   From 26ec685ff9d9c16525d8ec4c97e52fcdb187b302 Mon Sep 17 00:00:00 2001
- *   From: Takashi Iwai <tiwai@suse.de>
- *   Date: Fri, 11 May 2012 07:51:17 +0200
- *   Subject: [PATCH] vga_switcheroo: Introduce struct vga_switcheroo_client_ops
- *
- */
-
-struct vga_switcheroo_client_ops {
-    void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state);
-    void (*reprobe)(struct pci_dev *dev);
-    bool (*can_switch)(struct pci_dev *dev);
-};
-
-/* Wrap around the old code and redefine vga_switcheroo_register_client()
- * for older kernels < 3.5.0.
- */
-static inline int compat_vga_switcheroo_register_client(struct pci_dev *dev,
-		const struct vga_switcheroo_client_ops *ops) {
-
-	return vga_switcheroo_register_client(dev,
-					      ops->set_gpu_state,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
-					      ops->reprobe,
-#endif
-					      ops->can_switch);
-}
-
-#define vga_switcheroo_register_client(_dev, _ops) \
-	compat_vga_switcheroo_register_client(_dev, _ops)
-
-#endif
-
-/* This backports
- *
- * commit 14674e70119ea01549ce593d8901a797f8a90f74
- * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
- * Date:   Wed May 30 10:55:34 2012 +0200
- *
- *     i2c: Split I2C_M_NOSTART support out of I2C_FUNC_PROTOCOL_MANGLING
- */
-
-#define I2C_FUNC_NOSTART 0x00000010 /* I2C_M_NOSTART */
-
-/*
- * This backports:
- *
- *   From a3860c1c5dd1137db23d7786d284939c5761d517 Mon Sep 17 00:00:00 2001
- *   From: Xi Wang <xi.wang@gmail.com>
- *   Date: Thu, 31 May 2012 16:26:04 -0700
- *   Subject: [PATCH] introduce SIZE_MAX
- */
-
-#define SIZE_MAX    (~(size_t)0)
-
-
-#include <linux/pkt_sched.h>
-
-/*
- * This backports:
- *
- *   From 76e3cc126bb223013a6b9a0e2a51238d1ef2e409 Mon Sep 17 00:00:00 2001
- *   From: Eric Dumazet <edumazet@google.com>
- *   Date: Thu, 10 May 2012 07:51:25 +0000
- *   Subject: [PATCH] codel: Controlled Delay AQM
- */
-
-#ifndef TCA_CODEL_MAX
-/* CODEL */
-
-#define COMPAT_CODEL_BACKPORT
-
-enum {
-	TCA_CODEL_UNSPEC,
-	TCA_CODEL_TARGET,
-	TCA_CODEL_LIMIT,
-	TCA_CODEL_INTERVAL,
-	TCA_CODEL_ECN,
-	__TCA_CODEL_MAX
-};
-
-#define TCA_CODEL_MAX	(__TCA_CODEL_MAX - 1)
-
-struct tc_codel_xstats {
-	__u32	maxpacket; /* largest packet we've seen so far */
-	__u32	count;	   /* how many drops we've done since the last time we
-			    * entered dropping state
-			    */
-	__u32	lastcount; /* count at entry to dropping state */
-	__u32	ldelay;    /* in-queue delay seen by most recently dequeued packet */
-	__s32	drop_next; /* time to drop next packet */
-	__u32	drop_overlimit; /* number of time max qdisc packet limit was hit */
-	__u32	ecn_mark;  /* number of packets we ECN marked instead of dropped */
-	__u32	dropping;  /* are we in dropping state ? */
-};
-
-/* This backports:
- *
- * commit 4b549a2ef4bef9965d97cbd992ba67930cd3e0fe
- * Author: Eric Dumazet <edumazet@google.com>
- * Date:   Fri May 11 09:30:50 2012 +0000
- *    fq_codel: Fair Queue Codel AQM
- */
-
-/* FQ_CODEL */
-
-enum {
-	TCA_FQ_CODEL_UNSPEC,
-	TCA_FQ_CODEL_TARGET,
-	TCA_FQ_CODEL_LIMIT,
-	TCA_FQ_CODEL_INTERVAL,
-	TCA_FQ_CODEL_ECN,
-	TCA_FQ_CODEL_FLOWS,
-	TCA_FQ_CODEL_QUANTUM,
-	__TCA_FQ_CODEL_MAX
-};
-
-#define TCA_FQ_CODEL_MAX	(__TCA_FQ_CODEL_MAX - 1)
-
-enum {
-	TCA_FQ_CODEL_XSTATS_QDISC,
-	TCA_FQ_CODEL_XSTATS_CLASS,
-};
-
-struct tc_fq_codel_qd_stats {
-	__u32	maxpacket;	/* largest packet we've seen so far */
-	__u32	drop_overlimit; /* number of time max qdisc
-				 * packet limit was hit
-				 */
-	__u32	ecn_mark;	/* number of packets we ECN marked
-				 * instead of being dropped
-				 */
-	__u32	new_flow_count; /* number of time packets
-				 * created a 'new flow'
-				 */
-	__u32	new_flows_len;	/* count of flows in new list */
-	__u32	old_flows_len;	/* count of flows in old list */
-};
-
-struct tc_fq_codel_cl_stats {
-	__s32	deficit;
-	__u32	ldelay;		/* in-queue delay seen by most recently
-				 * dequeued packet
-				 */
-	__u32	count;
-	__u32	lastcount;
-	__u32	dropping;
-	__s32	drop_next;
-};
-
-struct tc_fq_codel_xstats {
-	__u32	type;
-	union {
-		struct tc_fq_codel_qd_stats qdisc_stats;
-		struct tc_fq_codel_cl_stats class_stats;
-	};
-};
-#endif /* TCA_CODEL_MAX */
-
-/* Backport ether_addr_equal */
-static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
-{
-    return !compare_ether_addr(addr1, addr2);
-}
-
-#define net_ratelimited_function(function, ...)			\
-do {								\
-	if (net_ratelimit())					\
-		function(__VA_ARGS__);				\
-} while (0)
-
-#define net_emerg_ratelimited(fmt, ...)				\
-	net_ratelimited_function(pr_emerg, fmt, ##__VA_ARGS__)
-#define net_alert_ratelimited(fmt, ...)				\
-	net_ratelimited_function(pr_alert, fmt, ##__VA_ARGS__)
-#define net_crit_ratelimited(fmt, ...)				\
-	net_ratelimited_function(pr_crit, fmt, ##__VA_ARGS__)
-#define net_err_ratelimited(fmt, ...)				\
-	net_ratelimited_function(pr_err, fmt, ##__VA_ARGS__)
-#define net_notice_ratelimited(fmt, ...)			\
-	net_ratelimited_function(pr_notice, fmt, ##__VA_ARGS__)
-#define net_warn_ratelimited(fmt, ...)				\
-	net_ratelimited_function(pr_warn, fmt, ##__VA_ARGS__)
-#define net_info_ratelimited(fmt, ...)				\
-	net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__)
-#define net_dbg_ratelimited(fmt, ...)				\
-	net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
-
-#define ktime_get_monotonic_offset LINUX_BACKPORT(ktime_get_monotonic_offset)
-extern ktime_t ktime_get_monotonic_offset(void);
-
-/* This backports:
- *
- * commit 2033e9bf06f07e049bbc77e9452856df846714cc
- * Author: Neil Horman <nhorman@tuxdriver.com>
- * Date:   Tue May 29 09:30:40 2012 +0000
- *
- *     net: add MODULE_ALIAS_NET_PF_PROTO_NAME
- */
-
-#define MODULE_ALIAS_NET_PF_PROTO_NAME(pf, proto, name) \
-	MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \
-		     name)
-
-/* This backports:
- *
- * commit e9412c37082b5c932e83364aaed0c38c2ce33acb
- * Author: Neil Horman <nhorman@tuxdriver.com>
- * Date:   Tue May 29 09:30:41 2012 +0000
- *
- *     genetlink: Build a generic netlink family module alias
- */
-
-#define MODULE_ALIAS_GENL_FAMILY(family)\
- MODULE_ALIAS_NET_PF_PROTO_NAME(PF_NETLINK, NETLINK_GENERIC, "-family-" family)
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
-
-#endif /* LINUX_3_5_COMPAT_H */
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 2851dae..872d704 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -19,4 +19,48 @@
 void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+#define devres_release LINUX_BACKPORT(devres_release)
+extern int devres_release(struct device *dev, dr_release_t release,
+			  dr_match_t match, void *match_data);
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+#include <linux/ratelimit.h>
+
+#define dev_level_ratelimited(dev_level, dev, fmt, ...)			\
+do {									\
+	static DEFINE_RATELIMIT_STATE(_rs,				\
+				      DEFAULT_RATELIMIT_INTERVAL,	\
+				      DEFAULT_RATELIMIT_BURST);		\
+	if (__ratelimit(&_rs))						\
+		dev_level(dev, fmt, ##__VA_ARGS__);			\
+} while (0)
+
+#define dev_emerg_ratelimited(dev, fmt, ...)				\
+	dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__)
+#define dev_alert_ratelimited(dev, fmt, ...)				\
+	dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__)
+
+
+#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
+#define dev_dbg_ratelimited(dev, fmt, ...)				\
+do {									\
+	static DEFINE_RATELIMIT_STATE(_rs,				\
+				      DEFAULT_RATELIMIT_INTERVAL,	\
+				      DEFAULT_RATELIMIT_BURST);		\
+	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);			\
+	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) &&	\
+	    __ratelimit(&_rs))						\
+		__dynamic_pr_debug(&descriptor, pr_fmt(fmt),		\
+				   ##__VA_ARGS__);			\
+} while (0)
+#else
+#define dev_dbg_ratelimited(dev, fmt, ...)			\
+	no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#endif /* dynamic debug */
+#endif /* 2.6.27 <= version <= 3.5 */
+
 #endif /* __BACKPORT_DEVICE_H */
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index 1246be4..aba5e67 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -47,4 +47,11 @@ static inline void eth_zero_addr(u8 *addr)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
+{
+	return !compare_ether_addr(addr1, addr2);
+}
+#endif
+
 #endif /* _BACKPORT_LINUX_ETHERDEVICE_H */
diff --git a/backport/backport-include/linux/genetlink.h b/backport/backport-include/linux/genetlink.h
new file mode 100644
index 0000000..afd1f67
--- /dev/null
+++ b/backport/backport-include/linux/genetlink.h
@@ -0,0 +1,18 @@
+#ifndef __BACKPORT_LINUX_GENETLINK_H
+#define __BACKPORT_LINUX_GENETLINK_H
+#include_next <linux/genetlink.h>
+
+/* This backports:
+ *
+ * commit e9412c37082b5c932e83364aaed0c38c2ce33acb
+ * Author: Neil Horman <nhorman@tuxdriver.com>
+ * Date:   Tue May 29 09:30:41 2012 +0000
+ *
+ *     genetlink: Build a generic netlink family module alias
+ */
+#ifndef MODULE_ALIAS_GENL_FAMILY
+#define MODULE_ALIAS_GENL_FAMILY(family)\
+ MODULE_ALIAS_NET_PF_PROTO_NAME(PF_NETLINK, NETLINK_GENERIC, "-family-" family)
+#endif
+
+#endif /* __BACKPORT_LINUX_GENETLINK_H */
diff --git a/backport/backport-include/linux/hrtimer.h b/backport/backport-include/linux/hrtimer.h
new file mode 100644
index 0000000..c099dd4
--- /dev/null
+++ b/backport/backport-include/linux/hrtimer.h
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_LINUX_HRTIMER_H
+#define __BACKPORT_LINUX_HRTIMER_H
+#include_next <linux/hrtimer.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+#define ktime_get_monotonic_offset LINUX_BACKPORT(ktime_get_monotonic_offset)
+extern ktime_t ktime_get_monotonic_offset(void);
+#endif
+
+#endif /* __BACKPORT_LINUX_HRTIMER_H */
diff --git a/backport/backport-include/linux/i2c.h b/backport/backport-include/linux/i2c.h
index 5b87732..1cbbd2f 100644
--- a/backport/backport-include/linux/i2c.h
+++ b/backport/backport-include/linux/i2c.h
@@ -12,4 +12,16 @@ extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 			  int num);
 #endif
 
+/* This backports
+ *
+ * commit 14674e70119ea01549ce593d8901a797f8a90f74
+ * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
+ * Date:   Wed May 30 10:55:34 2012 +0200
+ *
+ *     i2c: Split I2C_M_NOSTART support out of I2C_FUNC_PROTOCOL_MANGLING
+ */
+#ifndef I2C_FUNC_NOSTART
+#define I2C_FUNC_NOSTART 0x00000010 /* I2C_M_NOSTART */
+#endif
+
 #endif /* __BACKPORT_LINUX_I2C_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index 499f538..01aaa91 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -14,4 +14,16 @@ extern int strict_strtoul(const char *, unsigned int, unsigned long *);
 extern int strict_strtol(const char *, unsigned int, long *);
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) */
 
+/*
+ * This backports:
+ *
+ *   From a3860c1c5dd1137db23d7786d284939c5761d517 Mon Sep 17 00:00:00 2001
+ *   From: Xi Wang <xi.wang@gmail.com>
+ *   Date: Thu, 31 May 2012 16:26:04 -0700
+ *   Subject: [PATCH] introduce SIZE_MAX
+ */
+#ifndef SIZE_MAX
+#define SIZE_MAX    (~(size_t)0)
+#endif
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/net.h b/backport/backport-include/linux/net.h
new file mode 100644
index 0000000..9d7cbf5
--- /dev/null
+++ b/backport/backport-include/linux/net.h
@@ -0,0 +1,44 @@
+#ifndef __BACKPORT_LINUX_NET_H
+#define __BACKPORT_LINUX_NET_H
+#include_next <linux/net.h>
+
+/* This backports:
+ *
+ * commit 2033e9bf06f07e049bbc77e9452856df846714cc
+ * Author: Neil Horman <nhorman@tuxdriver.com>
+ * Date:   Tue May 29 09:30:40 2012 +0000
+ *
+ *     net: add MODULE_ALIAS_NET_PF_PROTO_NAME
+ */
+#ifndef MODULE_ALIAS_NET_PF_PROTO_NAME
+#define MODULE_ALIAS_NET_PF_PROTO_NAME(pf, proto, name) \
+	MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \
+		     name)
+#endif
+
+#ifndef net_ratelimited_function
+#define net_ratelimited_function(function, ...)			\
+do {								\
+	if (net_ratelimit())					\
+		function(__VA_ARGS__);				\
+} while (0)
+
+#define net_emerg_ratelimited(fmt, ...)				\
+	net_ratelimited_function(pr_emerg, fmt, ##__VA_ARGS__)
+#define net_alert_ratelimited(fmt, ...)				\
+	net_ratelimited_function(pr_alert, fmt, ##__VA_ARGS__)
+#define net_crit_ratelimited(fmt, ...)				\
+	net_ratelimited_function(pr_crit, fmt, ##__VA_ARGS__)
+#define net_err_ratelimited(fmt, ...)				\
+	net_ratelimited_function(pr_err, fmt, ##__VA_ARGS__)
+#define net_notice_ratelimited(fmt, ...)			\
+	net_ratelimited_function(pr_notice, fmt, ##__VA_ARGS__)
+#define net_warn_ratelimited(fmt, ...)				\
+	net_ratelimited_function(pr_warn, fmt, ##__VA_ARGS__)
+#define net_info_ratelimited(fmt, ...)				\
+	net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__)
+#define net_dbg_ratelimited(fmt, ...)				\
+	net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
+#endif
+
+#endif /* __BACKPORT_LINUX_NET_H */
diff --git a/backport/backport-include/linux/pagemap.h b/backport/backport-include/linux/pagemap.h
new file mode 100644
index 0000000..19d72de
--- /dev/null
+++ b/backport/backport-include/linux/pagemap.h
@@ -0,0 +1,76 @@
+#ifndef __BACKPORT_LINUX_PAGEMAP_H
+#define __BACKPORT_LINUX_PAGEMAP_H
+#include_next <linux/pagemap.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+#include <asm/uaccess.h>
+/*
+ * This backports:
+ *
+ * commit f56f821feb7b36223f309e0ec05986bb137ce418
+ * Author: Daniel Vetter <daniel.vetter@ffwll.ch>
+ * Date:   Sun Mar 25 19:47:41 2012 +0200
+ *
+ *     mm: extend prefault helpers to fault in more than PAGE_SIZE
+ *
+ * The new functions are used by drm/i915 driver.
+ *
+ */
+
+static inline int fault_in_multipages_writeable(char __user *uaddr, int size)
+{
+        int ret = 0;
+        char __user *end = uaddr + size - 1;
+
+        if (unlikely(size == 0))
+                return ret;
+
+        /*
+         * Writing zeroes into userspace here is OK, because we know that if
+         * the zero gets there, we'll be overwriting it.
+         */
+        while (uaddr <= end) {
+                ret = __put_user(0, uaddr);
+                if (ret != 0)
+                        return ret;
+                uaddr += PAGE_SIZE;
+        }
+
+        /* Check whether the range spilled into the next page. */
+        if (((unsigned long)uaddr & PAGE_MASK) ==
+                        ((unsigned long)end & PAGE_MASK))
+                ret = __put_user(0, end);
+
+        return ret;
+}
+
+static inline int fault_in_multipages_readable(const char __user *uaddr,
+                                               int size)
+{
+        volatile char c;
+        int ret = 0;
+        const char __user *end = uaddr + size - 1;
+
+        if (unlikely(size == 0))
+                return ret;
+
+        while (uaddr <= end) {
+                ret = __get_user(c, uaddr);
+                if (ret != 0)
+                        return ret;
+                uaddr += PAGE_SIZE;
+        }
+
+        /* Check whether the range spilled into the next page. */
+        if (((unsigned long)uaddr & PAGE_MASK) ==
+                        ((unsigned long)end & PAGE_MASK)) {
+                ret = __get_user(c, end);
+                (void)c;
+        }
+
+        return ret;
+}
+#endif /* < 3.5 */
+
+#endif /* __BACKPORT_LINUX_PAGEMAP_H */
diff --git a/backport/backport-include/linux/pkt_sched.h b/backport/backport-include/linux/pkt_sched.h
new file mode 100644
index 0000000..40ed863
--- /dev/null
+++ b/backport/backport-include/linux/pkt_sched.h
@@ -0,0 +1,106 @@
+#ifndef __BACKPORT_LINUX_PKT_SCHED_H
+#define __BACKPORT_LINUX_PKT_SCHED_H
+#include_next <linux/pkt_sched.h>
+#include <linux/version.h>
+
+/*
+ * This backports:
+ *
+ *   From 76e3cc126bb223013a6b9a0e2a51238d1ef2e409 Mon Sep 17 00:00:00 2001
+ *   From: Eric Dumazet <edumazet@google.com>
+ *   Date: Thu, 10 May 2012 07:51:25 +0000
+ *   Subject: [PATCH] codel: Controlled Delay AQM
+ */
+#ifndef TCA_CODEL_MAX
+/* CODEL */
+
+#define COMPAT_CODEL_BACKPORT
+
+enum {
+	TCA_CODEL_UNSPEC,
+	TCA_CODEL_TARGET,
+	TCA_CODEL_LIMIT,
+	TCA_CODEL_INTERVAL,
+	TCA_CODEL_ECN,
+	__TCA_CODEL_MAX
+};
+
+#define TCA_CODEL_MAX	(__TCA_CODEL_MAX - 1)
+
+struct tc_codel_xstats {
+	__u32	maxpacket; /* largest packet we've seen so far */
+	__u32	count;	   /* how many drops we've done since the last time we
+			    * entered dropping state
+			    */
+	__u32	lastcount; /* count at entry to dropping state */
+	__u32	ldelay;    /* in-queue delay seen by most recently dequeued packet */
+	__s32	drop_next; /* time to drop next packet */
+	__u32	drop_overlimit; /* number of time max qdisc packet limit was hit */
+	__u32	ecn_mark;  /* number of packets we ECN marked instead of dropped */
+	__u32	dropping;  /* are we in dropping state ? */
+};
+
+/* This backports:
+ *
+ * commit 4b549a2ef4bef9965d97cbd992ba67930cd3e0fe
+ * Author: Eric Dumazet <edumazet@google.com>
+ * Date:   Fri May 11 09:30:50 2012 +0000
+ *    fq_codel: Fair Queue Codel AQM
+ */
+
+/* FQ_CODEL */
+
+enum {
+	TCA_FQ_CODEL_UNSPEC,
+	TCA_FQ_CODEL_TARGET,
+	TCA_FQ_CODEL_LIMIT,
+	TCA_FQ_CODEL_INTERVAL,
+	TCA_FQ_CODEL_ECN,
+	TCA_FQ_CODEL_FLOWS,
+	TCA_FQ_CODEL_QUANTUM,
+	__TCA_FQ_CODEL_MAX
+};
+
+#define TCA_FQ_CODEL_MAX	(__TCA_FQ_CODEL_MAX - 1)
+
+enum {
+	TCA_FQ_CODEL_XSTATS_QDISC,
+	TCA_FQ_CODEL_XSTATS_CLASS,
+};
+
+struct tc_fq_codel_qd_stats {
+	__u32	maxpacket;	/* largest packet we've seen so far */
+	__u32	drop_overlimit; /* number of time max qdisc
+				 * packet limit was hit
+				 */
+	__u32	ecn_mark;	/* number of packets we ECN marked
+				 * instead of being dropped
+				 */
+	__u32	new_flow_count; /* number of time packets
+				 * created a 'new flow'
+				 */
+	__u32	new_flows_len;	/* count of flows in new list */
+	__u32	old_flows_len;	/* count of flows in old list */
+};
+
+struct tc_fq_codel_cl_stats {
+	__s32	deficit;
+	__u32	ldelay;		/* in-queue delay seen by most recently
+				 * dequeued packet
+				 */
+	__u32	count;
+	__u32	lastcount;
+	__u32	dropping;
+	__s32	drop_next;
+};
+
+struct tc_fq_codel_xstats {
+	__u32	type;
+	union {
+		struct tc_fq_codel_qd_stats qdisc_stats;
+		struct tc_fq_codel_cl_stats class_stats;
+	};
+};
+#endif /* TCA_CODEL_MAX */
+
+#endif /* __BACKPORT_LINUX_PKT_SCHED_H */
diff --git a/backport/backport-include/linux/regmap.h b/backport/backport-include/linux/regmap.h
new file mode 100644
index 0000000..fff8e46
--- /dev/null
+++ b/backport/backport-include/linux/regmap.h
@@ -0,0 +1,16 @@
+#ifndef __BACKPORT_LINUX_REGMAP_H
+#define __BACKPORT_LINUX_REGMAP_H
+#include_next <linux/regmap.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+#define dev_get_regmap LINUX_BACKPORT(dev_get_regmap)
+static inline
+struct regmap *dev_get_regmap(struct device *dev, const char *name)
+{
+	return NULL;
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_REGMAP_H */
diff --git a/backport/backport-include/linux/vga_switcheroo.h b/backport/backport-include/linux/vga_switcheroo.h
index 4bda17b..698f3f7 100644
--- a/backport/backport-include/linux/vga_switcheroo.h
+++ b/backport/backport-include/linux/vga_switcheroo.h
@@ -1,12 +1,43 @@
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+#ifndef __BACKPORT_VGA_SWITCHEROO_H
+#define __BACKPORT_VGA_SWITCHEROO_H
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)
+#include_next <linux/vga_switcheroo.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
 /*
- * XXX: The include guard was sent upstream, drop this
- * once the guard is merged.
+ * This backports:
+ *
+ *   From 26ec685ff9d9c16525d8ec4c97e52fcdb187b302 Mon Sep 17 00:00:00 2001
+ *   From: Takashi Iwai <tiwai@suse.de>
+ *   Date: Fri, 11 May 2012 07:51:17 +0200
+ *   Subject: [PATCH] vga_switcheroo: Introduce struct vga_switcheroo_client_ops
+ *
  */
-#ifndef LINUX_VGA_SWITCHEROO_H /* in case this gets upstream */
-#include_next <linux/vga_switcheroo.h>
-#ifndef LINUX_VGA_SWITCHEROO_H /* do not redefine once this gets upstream */
-#define LINUX_VGA_SWITCHEROO_H
-#endif /* case 1 LINUX_VGA_SWITCHEROO_H */
-#endif /* case 2 LINUX_VGA_SWITCHEROO_H */
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+
+struct vga_switcheroo_client_ops {
+    void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state);
+    void (*reprobe)(struct pci_dev *dev);
+    bool (*can_switch)(struct pci_dev *dev);
+};
+
+/* Wrap around the old code and redefine vga_switcheroo_register_client()
+ * for older kernels < 3.5.0.
+ */
+static inline int compat_vga_switcheroo_register_client(struct pci_dev *dev,
+		const struct vga_switcheroo_client_ops *ops) {
+
+	return vga_switcheroo_register_client(dev,
+					      ops->set_gpu_state,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
+					      ops->reprobe,
+#endif
+					      ops->can_switch);
+}
+
+#define vga_switcheroo_register_client(_dev, _ops) \
+	compat_vga_switcheroo_register_client(_dev, _ops)
+
+#endif /* < 3.5 */
+
+#endif /* >= 2.6.34 */
+#endif /* __BACKPORT_VGA_SWITCHEROO_H */
diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
index ee51de6..39e0149 100644
--- a/backport/backport-include/net/netlink.h
+++ b/backport/backport-include/net/netlink.h
@@ -93,4 +93,30 @@ static inline s64 nla_get_s64(struct nlattr *nla)
 }
 #endif /* < 3.7.0 */
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
+/*
+ * This backports:
+ * commit 569a8fc38367dfafd87454f27ac646c8e6b54bca
+ * Author: David S. Miller <davem@davemloft.net>
+ * Date:   Thu Mar 29 23:18:53 2012 -0400
+ *
+ *     netlink: Add nla_put_be{16,32,64}() helpers.
+ */
+
+static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
+{
+	return nla_put(skb, attrtype, sizeof(__be16), &value);
+}
+
+static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
+{
+	return nla_put(skb, attrtype, sizeof(__be32), &value);
+}
+
+static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
+{
+	return nla_put(skb, attrtype, sizeof(__be64), &value);
+}
+#endif /* < 3.5 */
+
 #endif /* __BACKPORT_NET_NETLINK_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 15/42] backports: dissolve backport.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (13 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 14/42] backports: dissolve compat-3.5.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 16/42] backports: dissolve compat-3.4.h Johannes Berg
                   ` (29 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

We'll resolve all the other compat-*.h files next.

To keep it compiling, we now also need to remove all
the pr_fmt patches (they add printk.h which can't be
included as the first header file any more.)

I attempted to simply not include anything from the
command line, but very old kernels (e.g. 2.6.24)
don't include kconfig.h from the command line but
include/linux/autoconf.h directly, and thus won't
get our override. Thus we need to keep a very small
backport.h.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/backport/backport.h      |  80 +---
 backport/backport-include/linux/module.h           |  37 ++
 backport/compat/compat-2.6.36.c                    |   1 +
 backport/compat/main.c                             |   1 +
 patches/collateral-evolutions/drm/98-pr_fmt/INFO   |   6 -
 .../98-pr_fmt/drivers_gpu_drm_drm_fb_helper.patch  |  14 -
 .../98-pr_fmt/drivers_gpu_drm_i915_i915_dma.patch  |  18 -
 .../98-pr_fmt/drivers_gpu_drm_i915_i915_irq.patch  |  13 -
 .../drivers_gpu_drm_i915_intel_opregion.patch      |  13 -
 .../drivers_gpu_drm_i915_intel_panel.patch         |  13 -
 .../drivers_gpu_drm_ttm_ttm_agp_backend.patch      |  13 -
 .../drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo.patch |  16 -
 .../98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo_vm.patch  |  13 -
 .../98-pr_fmt/drivers_gpu_drm_ttm_ttm_memory.patch |  16 -
 .../98-pr_fmt/drivers_gpu_drm_ttm_ttm_object.patch |  15 -
 .../drivers_gpu_drm_ttm_ttm_page_alloc.patch       |  13 -
 .../drivers_gpu_drm_ttm_ttm_page_alloc_dma.patch   |  13 -
 .../drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_tt.patch |  13 -
 .../collateral-evolutions/media/0001-pr_fmt.patch  | 493 ---------------------
 .../collateral-evolutions/network/53-pr_fmt/INFO   |   3 -
 .../53-pr_fmt/drivers_bcma_bcma_private.patch      |  15 -
 .../drivers_net_ethernet_broadcom_b44.patch        |  14 -
 .../drivers_net_wireless_ath_ath5k_ani.patch       |  14 -
 .../drivers_net_wireless_ath_ath5k_attach.patch    |  13 -
 .../drivers_net_wireless_ath_ath5k_base.patch      |  13 -
 .../drivers_net_wireless_ath_ath5k_debug.patch     |  13 -
 .../drivers_net_wireless_ath_ath5k_desc.patch      |  14 -
 .../drivers_net_wireless_ath_ath5k_dma.patch       |  14 -
 .../drivers_net_wireless_ath_ath5k_eeprom.patch    |  13 -
 .../drivers_net_wireless_ath_ath5k_initvals.patch  |  14 -
 .../drivers_net_wireless_ath_ath5k_led.patch       |  13 -
 ...ivers_net_wireless_ath_ath5k_mac80211-ops.patch |  17 -
 .../drivers_net_wireless_ath_ath5k_pci.patch       |  13 -
 .../drivers_net_wireless_ath_ath5k_phy.patch       |  13 -
 .../drivers_net_wireless_ath_ath5k_qcu.patch       |  14 -
 .../drivers_net_wireless_ath_ath5k_reset.patch     |  15 -
 .../drivers_net_wireless_ath_ath5k_sysfs.patch     |  10 -
 .../drivers_net_wireless_ath_ath6kl_cfg80211.patch |  13 -
 .../drivers_net_wireless_ath_ath6kl_init.patch     |  13 -
 .../drivers_net_wireless_ath_ath6kl_main.patch     |  14 -
 .../drivers_net_wireless_ath_ath6kl_txrx.patch     |  14 -
 ...ivers_net_wireless_ath_ath9k_htc_drv_init.patch |  14 -
 .../drivers_net_wireless_ath_ath9k_htc_hst.patch   |  14 -
 .../drivers_net_wireless_ath_ath9k_init.patch      |  13 -
 .../drivers_net_wireless_ath_ath9k_pci.patch       |  13 -
 .../53-pr_fmt/drivers_net_wireless_ath_main.patch  |  14 -
 .../53-pr_fmt/drivers_net_wireless_ath_regd.patch  |  14 -
 ...s_net_wireless_brcm80211_brcmsmac_aiutils.patch |  13 -
 ...t_wireless_brcm80211_brcmsmac_mac80211_if.patch |  13 -
 ...vers_net_wireless_brcm80211_brcmsmac_main.patch |  13 -
 ...net_wireless_brcm80211_brcmsmac_phy_phy_n.patch |  14 -
 ...ers_net_wireless_brcm80211_brcmutil_utils.patch |  13 -
 .../drivers_net_wireless_iwlegacy_3945-mac.patch   |  14 -
 .../drivers_net_wireless_iwlegacy_4965-mac.patch   |  14 -
 .../drivers_net_wireless_iwlwifi_dvm_main.patch    |  13 -
 .../drivers_net_wireless_iwlwifi_pcie_drv.patch    |  13 -
 .../drivers_net_wireless_libertas_cfg.patch        |  13 -
 .../drivers_net_wireless_libertas_if_cs.patch      |  13 -
 .../drivers_net_wireless_libertas_if_sdio.patch    |  14 -
 .../drivers_net_wireless_libertas_if_spi.patch     |  13 -
 .../drivers_net_wireless_libertas_if_usb.patch     |  13 -
 .../drivers_net_wireless_libertas_main.patch       |  13 -
 .../drivers_net_wireless_libertas_mesh.patch       |  10 -
 .../drivers_net_wireless_libertas_rx.patch         |  13 -
 .../drivers_net_wireless_libertas_tf_cmd.patch     |  13 -
 .../drivers_net_wireless_libertas_tf_if_usb.patch  |  16 -
 .../drivers_net_wireless_libertas_tf_main.patch    |  13 -
 .../drivers_net_wireless_rtlwifi_wifi.patch        |  13 -
 .../network/53-pr_fmt/net_bluetooth_lib.patch      |  14 -
 .../network/53-pr_fmt/net_wireless_core.patch      |  13 -
 .../network/53-pr_fmt/net_wireless_lib80211.patch  |  13 -
 .../net_wireless_lib80211_crypt_tkip.patch         |  13 -
 .../network/53-pr_fmt/net_wireless_reg.patch       |  14 -
 patches/collateral-evolutions/nfc/02-pr_fmt/INFO   |   6 -
 .../nfc/02-pr_fmt/net_nfc.patch                    | 181 --------
 75 files changed, 43 insertions(+), 1660 deletions(-)
 create mode 100644 backport/backport-include/linux/module.h
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/INFO
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_drm_fb_helper.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_i915_dma.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_i915_irq.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_intel_opregion.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_intel_panel.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_agp_backend.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo_vm.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_memory.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_object.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_page_alloc.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_page_alloc_dma.patch
 delete mode 100644 patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_tt.patch
 delete mode 100644 patches/collateral-evolutions/media/0001-pr_fmt.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/INFO
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_bcma_bcma_private.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_ethernet_broadcom_b44.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_ani.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_attach.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_base.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_debug.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_desc.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_dma.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_eeprom.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_initvals.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_led.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_mac80211-ops.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_pci.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_phy.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_qcu.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_reset.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_sysfs.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_cfg80211.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_init.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_main.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_txrx.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_htc_drv_init.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_htc_hst.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_init.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_pci.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_main.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_regd.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_aiutils.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_mac80211_if.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_main.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_phy_phy_n.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmutil_utils.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlegacy_3945-mac.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlegacy_4965-mac.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlwifi_dvm_main.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlwifi_pcie_drv.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_cfg.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_cs.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_sdio.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_spi.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_usb.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_main.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_mesh.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_rx.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_cmd.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_if_usb.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_main.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_rtlwifi_wifi.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_bluetooth_lib.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_wireless_core.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_wireless_lib80211.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_wireless_lib80211_crypt_tkip.patch
 delete mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_wireless_reg.patch
 delete mode 100644 patches/collateral-evolutions/nfc/02-pr_fmt/INFO
 delete mode 100644 patches/collateral-evolutions/nfc/02-pr_fmt/net_nfc.patch

diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index c5c194e..790fe48 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -1,82 +1,10 @@
-#ifndef LINUX_BACKPORT_H
-#define LINUX_BACKPORT_H
+#ifndef __BACKPORT_H
+#define __BACKPORT_H
+#include <backport/autoconf.h>
 
 #ifndef __ASSEMBLY__
-
 #define LINUX_BACKPORT(__sym) backport_ ##__sym
 #include <backport/checks.h>
-
-#include <linux/version.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
-#include <linux/kconfig.h>
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
-#include <generated/autoconf.h>
-#else
-#include <linux/autoconf.h>
 #endif
-#include <backport/autoconf.h>
-#include <linux/init.h>
-#include <linux/uidgid.h>
-#include <linux/module.h>
-
-/*
- * The define overwriting module_init is based on the original module_init
- * which looks like this:
- * #define module_init(initfn)					\
- *	static inline initcall_t __inittest(void)		\
- *	{ return initfn; }					\
- *	int init_module(void) __attribute__((alias(#initfn)));
- *
- * To the call to the initfn we added the symbol dependency on compat
- * to make sure that compat.ko gets loaded for any compat modules.
- */
-void backport_dependency_symbol(void);
-
-#ifdef BACKPORTS_GIT_TRACKED
-#define BACKPORT_MOD_VERSIONS MODULE_VERSION(BACKPORTS_GIT_TRACKED);
-#else
-#define BACKPORT_MOD_VERSIONS						\
-	MODULE_VERSION("backported from " BACKPORTED_KERNEL_NAME	\
-		       " (" BACKPORTED_KERNEL_VERSION ")"		\
-		       " using backports " BACKPORTS_VERSION);
-#endif
-
-#undef module_init
-#define module_init(initfn)						\
-	static int __init __init_backport(void)				\
-	{								\
-		backport_dependency_symbol();				\
-		return initfn();					\
-	}								\
-	int init_module(void) __attribute__((alias("__init_backport")));\
-	BACKPORT_MOD_VERSIONS
-
-/*
- * Each compat file represents compatibility code for new kernel
- * code introduced for *that* kernel revision.
- */
-
-#include <linux/compat-2.6.26.h>
-#include <linux/compat-2.6.27.h>
-#include <linux/compat-2.6.28.h>
-#include <linux/compat-2.6.29.h>
-#include <linux/compat-2.6.30.h>
-#include <linux/compat-2.6.31.h>
-#include <linux/compat-2.6.32.h>
-#include <linux/compat-2.6.33.h>
-#include <linux/compat-2.6.34.h>
-#include <linux/compat-2.6.35.h>
-#include <linux/compat-2.6.36.h>
-#include <linux/compat-2.6.37.h>
-#include <linux/compat-2.6.38.h>
-#include <linux/compat-2.6.39.h>
-#include <linux/compat-3.0.h>
-#include <linux/compat-3.1.h>
-#include <linux/compat-3.2.h>
-#include <linux/compat-3.3.h>
-#include <linux/compat-3.4.h>
-#include <linux/compat-3.5.h>
-
-#endif /* __ASSEMBLY__ */
 
-#endif /* LINUX_BACKPORT_H */
+#endif /* __BACKPORT_H */
diff --git a/backport/backport-include/linux/module.h b/backport/backport-include/linux/module.h
new file mode 100644
index 0000000..8112ebc
--- /dev/null
+++ b/backport/backport-include/linux/module.h
@@ -0,0 +1,37 @@
+#ifndef __BACKPORT_LINUX_MODULE_H
+#define __BACKPORT_LINUX_MODULE_H
+#include_next <linux/module.h>
+
+/*
+ * The define overwriting module_init is based on the original module_init
+ * which looks like this:
+ * #define module_init(initfn)					\
+ *	static inline initcall_t __inittest(void)		\
+ *	{ return initfn; }					\
+ *	int init_module(void) __attribute__((alias(#initfn)));
+ *
+ * To the call to the initfn we added the symbol dependency on compat
+ * to make sure that compat.ko gets loaded for any compat modules.
+ */
+extern void backport_dependency_symbol(void);
+
+#ifdef BACKPORTS_GIT_TRACKED
+#define BACKPORT_MOD_VERSIONS MODULE_VERSION(BACKPORTS_GIT_TRACKED);
+#else
+#define BACKPORT_MOD_VERSIONS						\
+	MODULE_VERSION("backported from " BACKPORTED_KERNEL_NAME	\
+		       " (" BACKPORTED_KERNEL_VERSION ")"		\
+		       " using backports " BACKPORTS_VERSION);
+#endif
+
+#undef module_init
+#define module_init(initfn)						\
+	static int __init __init_backport(void)				\
+	{								\
+		backport_dependency_symbol();				\
+		return initfn();					\
+	}								\
+	int init_module(void) __attribute__((alias("__init_backport")));\
+	BACKPORT_MOD_VERSIONS
+
+#endif /* __BACKPORT_LINUX_MODULE_H */
diff --git a/backport/compat/compat-2.6.36.c b/backport/compat/compat-2.6.36.c
index 92ef827..522205a 100644
--- a/backport/compat/compat-2.6.36.c
+++ b/backport/compat/compat-2.6.36.c
@@ -10,6 +10,7 @@
 
 #include <linux/compat.h>
 #include <linux/usb.h>
+#include <linux/compat-2.6.36.h>
 
 #ifdef CPTCFG_BACKPORT_OPTION_USB_URB_THREAD_FIX
 /* Callers must hold anchor->lock */
diff --git a/backport/compat/main.c b/backport/compat/main.c
index 9607209..4cc93c3 100644
--- a/backport/compat/main.c
+++ b/backport/compat/main.c
@@ -1,6 +1,7 @@
 #include <linux/module.h>
 #include <linux/pm_qos.h>
 #include "compat-2.6.34.h"
+#include <linux/compat-2.6.36.h>
 
 MODULE_AUTHOR("Luis R. Rodriguez");
 MODULE_DESCRIPTION("Kernel backport module");
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/INFO b/patches/collateral-evolutions/drm/98-pr_fmt/INFO
deleted file mode 100644
index d7895f4..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/INFO
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Undef/define/include printk.h for fixing redefinition warnings
-during build.
-
-Patch adapted from compat-wireless tree.
-
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_drm_fb_helper.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_drm_fb_helper.patch
deleted file mode 100644
index 49af9e7..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_drm_fb_helper.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/gpu/drm/drm_fb_helper.c
-+++ b/drivers/gpu/drm/drm_fb_helper.c
-@@ -27,9 +27,11 @@
-  *      Dave Airlie <airlied@linux.ie>
-  *      Jesse Barnes <jesse.barnes@intel.com>
-  */
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/sysrq.h>
- #include <linux/slab.h>
- #include <linux/fb.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_i915_dma.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_i915_dma.patch
deleted file mode 100644
index df64c81..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_i915_dma.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- a/drivers/gpu/drm/i915/i915_dma.c
-+++ b/drivers/gpu/drm/i915/i915_dma.c
-@@ -26,6 +26,7 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <drm/drmP.h>
-@@ -35,6 +36,7 @@
- #include <drm/i915_drm.h>
- #include "i915_drv.h"
- #include "i915_trace.h"
-+#include <linux/printk.h>
- #include <linux/pci.h>
- #include <linux/vgaarb.h>
- #include <linux/acpi.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_i915_irq.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_i915_irq.patch
deleted file mode 100644
index 923a8b4..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_i915_irq.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/gpu/drm/i915/i915_irq.c
-+++ b/drivers/gpu/drm/i915/i915_irq.c
-@@ -26,8 +26,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/sysrq.h>
- #include <linux/slab.h>
- #include <drm/drmP.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_intel_opregion.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_intel_opregion.patch
deleted file mode 100644
index 8279c93..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_intel_opregion.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/gpu/drm/i915/intel_opregion.c
-+++ b/drivers/gpu/drm/i915/intel_opregion.c
-@@ -25,8 +25,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/acpi.h>
- #include <linux/acpi_io.h>
- #include <acpi/video.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_intel_panel.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_intel_panel.patch
deleted file mode 100644
index 3a87d9f..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_i915_intel_panel.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/gpu/drm/i915/intel_panel.c
-+++ b/drivers/gpu/drm/i915/intel_panel.c
-@@ -28,8 +28,10 @@
-  *      Chris Wilson <chris@chris-wilson.co.uk>
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/moduleparam.h>
- #include "intel_drv.h"
- 
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_agp_backend.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_agp_backend.patch
deleted file mode 100644
index d4a791e..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_agp_backend.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
-+++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
-@@ -29,8 +29,10 @@
-  *          Keith Packard.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "[TTM] " fmt
- 
-+#include <linux/printk.h>
- #include <drm/ttm/ttm_module.h>
- #include <drm/ttm/ttm_bo_driver.h>
- #include <drm/ttm/ttm_page_alloc.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo.patch
deleted file mode 100644
index ac5cb1d..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/drivers/gpu/drm/ttm/ttm_bo.c
-+++ b/drivers/gpu/drm/ttm/ttm_bo.c
-@@ -28,11 +28,13 @@
-  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "[TTM] " fmt
- 
- #include <drm/ttm/ttm_module.h>
- #include <drm/ttm/ttm_bo_driver.h>
- #include <drm/ttm/ttm_placement.h>
-+#include <linux/printk.h>
- #include <linux/jiffies.h>
- #include <linux/slab.h>
- #include <linux/sched.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo_vm.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo_vm.patch
deleted file mode 100644
index 45c5f05..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_bo_vm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
-+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
-@@ -28,8 +28,10 @@
-  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "[TTM] " fmt
- 
-+#include <linux/printk.h>
- #include <ttm/ttm_module.h>
- #include <ttm/ttm_bo_driver.h>
- #include <ttm/ttm_placement.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_memory.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_memory.patch
deleted file mode 100644
index ce492cb..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_memory.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/drivers/gpu/drm/ttm/ttm_memory.c
-+++ b/drivers/gpu/drm/ttm/ttm_memory.c
-@@ -25,11 +25,13 @@
-  *
-  **************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "[TTM] " fmt
- 
- #include <drm/ttm/ttm_memory.h>
- #include <drm/ttm/ttm_module.h>
- #include <drm/ttm/ttm_page_alloc.h>
-+#include <linux/printk.h>
- #include <linux/spinlock.h>
- #include <linux/sched.h>
- #include <linux/wait.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_object.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_object.patch
deleted file mode 100644
index 7c8ed99..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_object.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/drivers/gpu/drm/ttm/ttm_object.c
-+++ b/drivers/gpu/drm/ttm/ttm_object.c
-@@ -49,10 +49,12 @@
-  * for fast lookup of ref objects given a base object.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "[TTM] " fmt
- 
- #include <drm/ttm/ttm_object.h>
- #include <drm/ttm/ttm_module.h>
-+#include <linux/printk.h>
- #include <linux/list.h>
- #include <linux/spinlock.h>
- #include <linux/slab.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_page_alloc.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_page_alloc.patch
deleted file mode 100644
index 3556538..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_page_alloc.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
-+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
-@@ -31,8 +31,10 @@
-  * - doesn't track currently in use pages
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "[TTM] " fmt
- 
-+#include <linux/printk.h>
- #include <linux/list.h>
- #include <linux/spinlock.h>
- #include <linux/highmem.h>
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_page_alloc_dma.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_page_alloc_dma.patch
deleted file mode 100644
index a2c700a..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_page_alloc_dma.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
-+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
-@@ -33,8 +33,10 @@
-  *   when freed).
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "[TTM] " fmt
- 
-+#include <linux/printk.h>
- #include <linux/dma-mapping.h>
- #include <linux/list.h>
- #include <linux/seq_file.h> /* for seq_printf */
diff --git a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_tt.patch b/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_tt.patch
deleted file mode 100644
index 2925d7d..0000000
--- a/patches/collateral-evolutions/drm/98-pr_fmt/drivers_gpu_drm_ttm_ttm_tt.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/gpu/drm/ttm/ttm_tt.c
-+++ b/drivers/gpu/drm/ttm/ttm_tt.c
-@@ -28,8 +28,10 @@
-  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "[TTM] " fmt
- 
-+#include <linux/printk.h>
- #include <linux/sched.h>
- #include <linux/highmem.h>
- #include <linux/pagemap.h>
diff --git a/patches/collateral-evolutions/media/0001-pr_fmt.patch b/patches/collateral-evolutions/media/0001-pr_fmt.patch
deleted file mode 100644
index 17aa93a..0000000
--- a/patches/collateral-evolutions/media/0001-pr_fmt.patch
+++ /dev/null
@@ -1,493 +0,0 @@
-We can't really get this udef'd in any easier way. If you figure it out..
-great.
-
---- a/drivers/media/media-devnode.c
-+++ b/drivers/media/media-devnode.c
-@@ -29,11 +29,12 @@
-  * character devices using a dynamic major number and proper reference
-  * counting.
-  */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/errno.h>
- #include <linux/init.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/kernel.h>
- #include <linux/kmod.h>
---- a/drivers/media/common/saa7146/saa7146_i2c.c
-+++ b/drivers/media/common/saa7146/saa7146_i2c.c
-@@ -1,5 +1,7 @@
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <media/saa7146_vv.h>
- 
- static u32 saa7146_i2c_func(struct i2c_adapter *adapter)
---- a/drivers/media/common/saa7146/saa7146_fops.c
-+++ b/drivers/media/common/saa7146/saa7146_fops.c
-@@ -1,5 +1,7 @@
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <media/saa7146_vv.h>
- #include <linux/module.h>
- 
---- a/drivers/media/common/saa7146/saa7146_core.c
-+++ b/drivers/media/common/saa7146/saa7146_core.c
-@@ -17,9 +17,10 @@
-     along with this program; if not, write to the Free Software
-     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <media/saa7146.h>
- #include <linux/module.h>
- 
---- a/drivers/media/common/saa7146/saa7146_video.c
-+++ b/drivers/media/common/saa7146/saa7146_video.c
-@@ -1,9 +1,11 @@
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <media/saa7146_vv.h>
- #include <media/v4l2-chip-ident.h>
- #include <media/v4l2-event.h>
- #include <media/v4l2-ctrls.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- 
- static int max_memory = 32;
---- a/drivers/media/common/saa7146/saa7146_hlp.c
-+++ b/drivers/media/common/saa7146/saa7146_hlp.c
-@@ -1,5 +1,7 @@
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/kernel.h>
- #include <linux/export.h>
- #include <media/saa7146_vv.h>
---- a/drivers/media/pci/bt8xx/bttv-driver.c
-+++ b/drivers/media/pci/bt8xx/bttv-driver.c
-@@ -34,8 +34,10 @@
-     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/init.h>
- #include <linux/module.h>
- #include <linux/delay.h>
---- a/drivers/media/pci/bt8xx/bttv-cards.c
-+++ b/drivers/media/pci/bt8xx/bttv-cards.c
-@@ -24,9 +24,10 @@
-     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- 
- */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/module.h>
- #include <linux/kmod.h>
---- a/drivers/media/dvb-frontends/nxt200x.c
-+++ b/drivers/media/dvb-frontends/nxt200x.c
-@@ -37,12 +37,14 @@
-  * /usr/lib/hotplug/firmware/ or /lib/firmware/
-  * (depending on configuration of firmware hotplug).
-  */
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #define NXT2002_DEFAULT_FIRMWARE "dvb-fe-nxt2002.fw"
- #define NXT2004_DEFAULT_FIRMWARE "dvb-fe-nxt2004.fw"
- #define CRC_CCIT_MASK 0x1021
- 
-+#include <linux/printk.h>
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/module.h>
---- a/drivers/media/dvb-frontends/or51211.c
-+++ b/drivers/media/dvb-frontends/or51211.c
-@@ -21,7 +21,7 @@
-  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  *
- */
--
-+#undef pr_fmt
- #define pr_fmt(fmt)	KBUILD_MODNAME ": %s: " fmt, __func__
- 
- /*
-@@ -32,6 +32,7 @@
-  */
- #define OR51211_DEFAULT_FIRMWARE "dvb-fe-or51211.fw"
- 
-+#include <linux/printk.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/device.h>
---- a/drivers/media/pci/bt8xx/bttv-risc.c
-+++ b/drivers/media/pci/bt8xx/bttv-risc.c
-@@ -23,9 +23,10 @@
-     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- 
- */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/slab.h>
---- a/drivers/media/pci/bt8xx/bttv-vbi.c
-+++ b/drivers/media/pci/bt8xx/bttv-vbi.c
-@@ -22,9 +22,10 @@
-     along with this program; if not, write to the Free Software
-     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/errno.h>
- #include <linux/fs.h>
---- a/drivers/media/pci/bt8xx/bttv-i2c.c
-+++ b/drivers/media/pci/bt8xx/bttv-i2c.c
-@@ -26,9 +26,10 @@
-     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- 
- */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/delay.h>
---- a/drivers/media/pci/bt8xx/bttv-gpio.c
-+++ b/drivers/media/pci/bt8xx/bttv-gpio.c
-@@ -25,9 +25,10 @@
-     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- 
- */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/delay.h>
---- a/drivers/media/pci/bt8xx/bttv-input.c
-+++ b/drivers/media/pci/bt8xx/bttv-input.c
-@@ -17,9 +17,10 @@
-  * along with this program; if not, write to the Free Software
-  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-  */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/delay.h>
---- a/drivers/media/pci/bt8xx/dvb-bt8xx.c
-+++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c
-@@ -19,8 +19,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "dvb_bt8xx: " fmt
- 
-+#include <linux/printk.h>
- #include <linux/bitops.h>
- #include <linux/module.h>
- #include <linux/init.h>
---- a/drivers/media/common/siano/smsdvb-debugfs.c
-+++ b/drivers/media/common/siano/smsdvb-debugfs.c
-@@ -17,8 +17,10 @@
-  *
-  ***********************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/slab.h>
- #include <linux/init.h>
---- a/drivers/media/pci/cx25821/cx25821-alsa.c
-+++ b/drivers/media/pci/cx25821/cx25821-alsa.c
-@@ -20,8 +20,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/device.h>
---- a/drivers/media/pci/cx25821/cx25821-audio-upstream.c
-+++ b/drivers/media/pci/cx25821/cx25821-audio-upstream.c
-@@ -20,11 +20,13 @@
-  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include "cx25821-video.h"
- #include "cx25821-audio-upstream.h"
- 
-+#include <linux/printk.h>
- #include <linux/fs.h>
- #include <linux/errno.h>
- #include <linux/kernel.h>
---- a/drivers/media/pci/cx25821/cx25821-cards.c
-+++ b/drivers/media/pci/cx25821/cx25821-cards.c
-@@ -21,8 +21,10 @@
-  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/init.h>
- #include <linux/module.h>
- #include <linux/pci.h>
---- a/drivers/media/pci/cx25821/cx25821-core.c
-+++ b/drivers/media/pci/cx25821/cx25821-core.c
-@@ -21,8 +21,10 @@
-  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/i2c.h>
- #include <linux/slab.h>
- #include "cx25821.h"
---- a/drivers/media/pci/cx25821/cx25821-i2c.c
-+++ b/drivers/media/pci/cx25821/cx25821-i2c.c
-@@ -21,9 +21,11 @@
-  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include "cx25821.h"
-+#include <linux/printk.h>
- #include <linux/i2c.h>
- 
- static unsigned int i2c_debug;
---- a/drivers/media/pci/cx25821/cx25821-medusa-video.c
-+++ b/drivers/media/pci/cx25821/cx25821-medusa-video.c
-@@ -20,12 +20,15 @@
-  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include "cx25821.h"
- #include "cx25821-medusa-video.h"
- #include "cx25821-biffuncs.h"
- 
-+#include <linux/printk.h>
-+
- /*
-  * medusa_enable_bluefield_output()
-  *
---- a/drivers/media/pci/cx25821/cx25821-video.c
-+++ b/drivers/media/pci/cx25821/cx25821-video.c
-@@ -24,9 +24,11 @@
-  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include "cx25821-video.h"
-+#include <linux/printk.h>
- 
- MODULE_DESCRIPTION("v4l2 driver module for cx25821 based TV cards");
- MODULE_AUTHOR("Hiep Huynh <hiep.huynh@conexant.com>");
---- a/drivers/media/pci/cx25821/cx25821-video-upstream.c
-+++ b/drivers/media/pci/cx25821/cx25821-video-upstream.c
-@@ -20,11 +20,13 @@
-  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include "cx25821-video.h"
- #include "cx25821-video-upstream.h"
- 
-+#include <linux/printk.h>
- #include <linux/fs.h>
- #include <linux/errno.h>
- #include <linux/kernel.h>
---- a/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c
-+++ b/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c
-@@ -20,11 +20,13 @@
-  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include "cx25821-video.h"
- #include "cx25821-video-upstream-ch2.h"
- 
-+#include <linux/printk.h>
- #include <linux/fs.h>
- #include <linux/errno.h>
- #include <linux/kernel.h>
---- a/drivers/media/rc/imon.c
-+++ b/drivers/media/rc/imon.c
-@@ -26,8 +26,10 @@
-  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/errno.h>
- #include <linux/init.h>
- #include <linux/kernel.h>
---- a/drivers/media/rc/fintek-cir.c
-+++ b/drivers/media/rc/fintek-cir.c
-@@ -23,8 +23,10 @@
-  * USA
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/pnp.h>
---- a/drivers/media/rc/nuvoton-cir.c
-+++ b/drivers/media/rc/nuvoton-cir.c
-@@ -25,8 +25,10 @@
-  * USA
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/pnp.h>
---- a/drivers/media/rc/ene_ir.c
-+++ b/drivers/media/rc/ene_ir.c
-@@ -30,8 +30,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/pnp.h>
---- a/drivers/media/rc/winbond-cir.c
-+++ b/drivers/media/rc/winbond-cir.c
-@@ -40,8 +40,10 @@
-  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/pnp.h>
- #include <linux/interrupt.h>
---- a/drivers/media/pci/saa7146/hexium_orion.c
-+++ b/drivers/media/pci/saa7146/hexium_orion.c
-@@ -21,11 +21,13 @@
-     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #define DEBUG_VARIABLE debug
- 
- #include <media/saa7146_vv.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- 
- static int debug;
---- a/drivers/media/pci/saa7146/hexium_gemini.c
-+++ b/drivers/media/pci/saa7146/hexium_gemini.c
-@@ -21,12 +21,14 @@
-     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #define DEBUG_VARIABLE debug
- 
- #include <media/saa7146_vv.h>
- #include <linux/module.h>
-+#include <linux/printk.h>
- 
- static int debug;
- module_param(debug, int, 0);
---- a/drivers/media/pci/ttpci/budget-av.c
-+++ b/drivers/media/pci/ttpci/budget-av.c
-@@ -33,8 +33,10 @@
-  * the project's page is at http://www.linuxtv.org/ 
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include "budget.h"
- #include "stv0299.h"
- #include "stb0899_drv.h"
---- a/drivers/media/pci/ttpci/av7110_v4l.c
-+++ b/drivers/media/pci/ttpci/av7110_v4l.c
-@@ -25,8 +25,10 @@
-  * the project's page is at http://www.linuxtv.org/ 
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/kernel.h>
- #include <linux/types.h>
- #include <linux/delay.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/INFO b/patches/collateral-evolutions/network/53-pr_fmt/INFO
deleted file mode 100644
index cd88ad5..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/INFO
+++ /dev/null
@@ -1,3 +0,0 @@
-This is the correct way to use pr_fmt. This helps avoid
-compiler warnings. This is going to be sent upstream.
-
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_bcma_bcma_private.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_bcma_bcma_private.patch
deleted file mode 100644
index 913deec..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_bcma_bcma_private.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/drivers/bcma/bcma_private.h
-+++ b/drivers/bcma/bcma_private.h
-@@ -1,10 +1,10 @@
- #ifndef LINUX_BCMA_PRIVATE_H_
- #define LINUX_BCMA_PRIVATE_H_
- 
--#ifndef pr_fmt
-+#undef pr_fmt
- #define pr_fmt(fmt)		KBUILD_MODNAME ": " fmt
--#endif
- 
-+#include <linux/printk.h>
- #include <linux/bcma/bcma.h>
- #include <linux/delay.h>
- 
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_ethernet_broadcom_b44.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_ethernet_broadcom_b44.patch
deleted file mode 100644
index 1579058..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_ethernet_broadcom_b44.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/ethernet/broadcom/b44.c
-+++ b/drivers/net/ethernet/broadcom/b44.c
-@@ -10,9 +10,11 @@
-  * Distribute under GPL.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/moduleparam.h>
- #include <linux/types.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_ani.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_ani.patch
deleted file mode 100644
index 53aee64..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_ani.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/ani.c
-+++ b/drivers/net/wireless/ath/ath5k/ani.c
-@@ -14,8 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_attach.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_attach.patch
deleted file mode 100644
index 2c6ba9f..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_attach.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/attach.c
-+++ b/drivers/net/wireless/ath/ath5k/attach.c
-@@ -20,8 +20,10 @@
- * Attach/Detach Functions and helpers *
- \*************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/pci.h>
- #include <linux/slab.h>
- #include "ath5k.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_base.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_base.patch
deleted file mode 100644
index fd837ab..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_base.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/base.c
-+++ b/drivers/net/wireless/ath/ath5k/base.c
-@@ -40,8 +40,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/delay.h>
- #include <linux/dma-mapping.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_debug.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_debug.patch
deleted file mode 100644
index ff2d8df..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_debug.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/debug.c
-+++ b/drivers/net/wireless/ath/ath5k/debug.c
-@@ -58,8 +58,10 @@
-  * THE POSSIBILITY OF SUCH DAMAGES.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/export.h>
- #include <linux/moduleparam.h>
- 
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_desc.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_desc.patch
deleted file mode 100644
index 034e481..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_desc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/desc.c
-+++ b/drivers/net/wireless/ath/ath5k/desc.c
-@@ -21,8 +21,11 @@
-  Hardware Descriptor Functions
- \******************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_dma.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_dma.patch
deleted file mode 100644
index daaf54f..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_dma.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/dma.c
-+++ b/drivers/net/wireless/ath/ath5k/dma.c
-@@ -29,8 +29,11 @@
-  * status registers (ISR).
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_eeprom.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_eeprom.patch
deleted file mode 100644
index d05d207..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_eeprom.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/eeprom.c
-+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
-@@ -21,8 +21,10 @@
- * EEPROM access functions and helpers *
- \*************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/slab.h>
- 
- #include "ath5k.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_initvals.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_initvals.patch
deleted file mode 100644
index ba94dd3..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_initvals.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/initvals.c
-+++ b/drivers/net/wireless/ath/ath5k/initvals.c
-@@ -19,8 +19,11 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_led.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_led.patch
deleted file mode 100644
index 05b91bf..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_led.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/led.c
-+++ b/drivers/net/wireless/ath/ath5k/led.c
-@@ -39,8 +39,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/pci.h>
- #include "ath5k.h"
- 
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_mac80211-ops.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_mac80211-ops.patch
deleted file mode 100644
index a11835b..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_mac80211-ops.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
-+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
-@@ -41,11 +41,14 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <net/mac80211.h>
- #include <asm/unaligned.h>
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "base.h"
- #include "reg.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_pci.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_pci.patch
deleted file mode 100644
index 3affa13..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_pci.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/pci.c
-+++ b/drivers/net/wireless/ath/ath5k/pci.c
-@@ -14,8 +14,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/nl80211.h>
- #include <linux/pci.h>
- #include <linux/pci-aspm.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_phy.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_phy.patch
deleted file mode 100644
index 84ab4db..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_phy.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/phy.c
-+++ b/drivers/net/wireless/ath/ath5k/phy.c
-@@ -22,8 +22,10 @@
- * PHY related functions *
- \***********************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/slab.h>
- #include <asm/unaligned.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_qcu.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_qcu.patch
deleted file mode 100644
index 92ae2fb..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_qcu.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/qcu.c
-+++ b/drivers/net/wireless/ath/ath5k/qcu.c
-@@ -20,8 +20,11 @@
- Queue Control Unit, DCF Control Unit Functions
- \********************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_reset.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_reset.patch
deleted file mode 100644
index 852fa3e..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_reset.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/reset.c
-+++ b/drivers/net/wireless/ath/ath5k/reset.c
-@@ -23,10 +23,12 @@
-   Reset function and helpers
- \****************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <asm/unaligned.h>
- 
-+#include <linux/printk.h>
- #include <linux/pci.h>		/* To determine if a card is pci-e */
- #include <linux/log2.h>
- #include <linux/platform_device.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_sysfs.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_sysfs.patch
deleted file mode 100644
index b7782bd..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath5k_sysfs.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/drivers/net/wireless/ath/ath5k/sysfs.c
-+++ b/drivers/net/wireless/ath/ath5k/sysfs.c
-@@ -1,5 +1,7 @@
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/device.h>
- #include <linux/pci.h>
- 
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_cfg80211.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_cfg80211.patch
deleted file mode 100644
index be1d7b3..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_cfg80211.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
-+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
-@@ -15,8 +15,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/moduleparam.h>
- #include <linux/inetdevice.h>
- #include <linux/export.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_init.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_init.patch
deleted file mode 100644
index b754cfd..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_init.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath6kl/init.c
-+++ b/drivers/net/wireless/ath/ath6kl/init.c
-@@ -16,8 +16,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/moduleparam.h>
- #include <linux/errno.h>
- #include <linux/export.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_main.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_main.patch
deleted file mode 100644
index 1490bb3..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_main.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath6kl/main.c
-+++ b/drivers/net/wireless/ath/ath6kl/main.c
-@@ -15,8 +15,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "core.h"
- #include "hif-ops.h"
- #include "cfg80211.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_txrx.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_txrx.patch
deleted file mode 100644
index 7a6fd42..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath6kl_txrx.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath6kl/txrx.c
-+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
-@@ -15,8 +15,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "core.h"
- #include "debug.h"
- #include "htc-ops.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_htc_drv_init.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_htc_drv_init.patch
deleted file mode 100644
index c129856..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_htc_drv_init.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
-+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
-@@ -14,8 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "htc.h"
- 
- MODULE_AUTHOR("Atheros Communications");
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_htc_hst.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_htc_hst.patch
deleted file mode 100644
index b88569a..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_htc_hst.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/htc_hst.c
-+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
-@@ -14,8 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "htc.h"
- 
- static int htc_issue_send(struct htc_target *target, struct sk_buff* skb,
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_init.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_init.patch
deleted file mode 100644
index 7de038e..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_init.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/init.c
-+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -14,8 +14,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/dma-mapping.h>
- #include <linux/slab.h>
- #include <linux/ath9k_platform.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_pci.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_pci.patch
deleted file mode 100644
index 45d362b..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_ath9k_pci.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/pci.c
-+++ b/drivers/net/wireless/ath/ath9k/pci.c
-@@ -14,8 +14,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/nl80211.h>
- #include <linux/pci.h>
- #include <linux/pci-aspm.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_main.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_main.patch
deleted file mode 100644
index 1fd9170..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_main.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/main.c
-+++ b/drivers/net/wireless/ath/main.c
-@@ -14,9 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- 
- #include "ath.h"
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_regd.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_regd.patch
deleted file mode 100644
index c147951..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_ath_regd.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/ath/regd.c
-+++ b/drivers/net/wireless/ath/regd.c
-@@ -14,9 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/export.h>
- #include <net/cfg80211.h>
- #include <net/mac80211.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_aiutils.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_aiutils.patch
deleted file mode 100644
index eb604a1..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_aiutils.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
-@@ -16,8 +16,10 @@
-  * File contents: support functions for PCI/PCIe
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- 
- #include <defs.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_mac80211_if.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_mac80211_if.patch
deleted file mode 100644
index bcd4f84..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_mac80211_if.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
-@@ -16,8 +16,10 @@
-  */
- 
- #define __UNDEF_NO_VERSION__
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/etherdevice.h>
- #include <linux/sched.h>
- #include <linux/firmware.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_main.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_main.patch
deleted file mode 100644
index 5a33c9c..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_main.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
-@@ -15,8 +15,10 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/pci_ids.h>
- #include <linux/if_ether.h>
- #include <net/cfg80211.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_phy_phy_n.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_phy_phy_n.patch
deleted file mode 100644
index 090eae8..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmsmac_phy_phy_n.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
-@@ -14,9 +14,11 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/cordic.h>
- 
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmutil_utils.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmutil_utils.patch
deleted file mode 100644
index 9d6ed29..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_brcm80211_brcmutil_utils.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/brcm80211/brcmutil/utils.c
-+++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c
-@@ -14,8 +14,10 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/netdevice.h>
- #include <linux/module.h>
- 
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlegacy_3945-mac.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlegacy_3945-mac.patch
deleted file mode 100644
index 90afaff..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlegacy_3945-mac.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/iwlegacy/3945-mac.c
-+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
-@@ -27,9 +27,11 @@
-  *
-  *****************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/pci.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlegacy_4965-mac.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlegacy_4965-mac.patch
deleted file mode 100644
index 6b44e95..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlegacy_4965-mac.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/iwlegacy/4965-mac.c
-+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
-@@ -27,9 +27,11 @@
-  *
-  *****************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/pci.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlwifi_dvm_main.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlwifi_dvm_main.patch
deleted file mode 100644
index 74429eb..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlwifi_dvm_main.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/iwlwifi/dvm/main.c
-+++ b/drivers/net/wireless/iwlwifi/dvm/main.c
-@@ -27,8 +27,10 @@
-  *
-  *****************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/init.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlwifi_pcie_drv.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlwifi_pcie_drv.patch
deleted file mode 100644
index 0e06ca3..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_iwlwifi_pcie_drv.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/iwlwifi/pcie/drv.c
-+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
-@@ -61,8 +61,10 @@
-  *
-  *****************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/pci.h>
- #include <linux/pci-aspm.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_cfg.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_cfg.patch
deleted file mode 100644
index d5250c5..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_cfg.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/libertas/cfg.c
-+++ b/drivers/net/wireless/libertas/cfg.c
-@@ -6,8 +6,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/hardirq.h>
- #include <linux/sched.h>
- #include <linux/wait.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_cs.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_cs.patch
deleted file mode 100644
index 9006395..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_cs.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/libertas/if_cs.c
-+++ b/drivers/net/wireless/libertas/if_cs.c
-@@ -21,8 +21,10 @@
- 
- */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/slab.h>
- #include <linux/delay.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_sdio.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_sdio.patch
deleted file mode 100644
index 13f793c..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_sdio.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/wireless/libertas/if_sdio.c
-+++ b/drivers/net/wireless/libertas/if_sdio.c
-@@ -26,9 +26,11 @@
-  * if_sdio_card_to_host() to pad the data.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/slab.h>
- #include <linux/firmware.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_spi.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_spi.patch
deleted file mode 100644
index 0946aab..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_spi.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/libertas/if_spi.c
-+++ b/drivers/net/wireless/libertas/if_spi.c
-@@ -17,8 +17,10 @@
-  * (at your option) any later version.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/hardirq.h>
- #include <linux/interrupt.h>
- #include <linux/module.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_usb.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_usb.patch
deleted file mode 100644
index a53b311..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_if_usb.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/libertas/if_usb.c
-+++ b/drivers/net/wireless/libertas/if_usb.c
-@@ -2,8 +2,10 @@
-  * This file contains functions used in USB interface module.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/module.h>
- #include <linux/firmware.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_main.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_main.patch
deleted file mode 100644
index a3837c9..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_main.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/libertas/main.c
-+++ b/drivers/net/wireless/libertas/main.c
-@@ -4,8 +4,10 @@
-  * thread etc..
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/delay.h>
- #include <linux/etherdevice.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_mesh.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_mesh.patch
deleted file mode 100644
index 3e3b7e6..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_mesh.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/drivers/net/wireless/libertas/mesh.c
-+++ b/drivers/net/wireless/libertas/mesh.c
-@@ -1,5 +1,7 @@
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/etherdevice.h>
- #include <linux/hardirq.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_rx.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_rx.patch
deleted file mode 100644
index eb81eaa..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_rx.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/libertas/rx.c
-+++ b/drivers/net/wireless/libertas/rx.c
-@@ -2,8 +2,10 @@
-  * This file contains the handling of RX in wlan driver.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/etherdevice.h>
- #include <linux/hardirq.h>
- #include <linux/slab.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_cmd.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_cmd.patch
deleted file mode 100644
index 27e8d84..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_cmd.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/libertas_tf/cmd.c
-+++ b/drivers/net/wireless/libertas_tf/cmd.c
-@@ -7,8 +7,10 @@
-  *  the Free Software Foundation; either version 2 of the License, or (at
-  *  your option) any later version.
-  */
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/hardirq.h>
- #include <linux/slab.h>
- #include <linux/export.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_if_usb.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_if_usb.patch
deleted file mode 100644
index 4d2fdf4..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_if_usb.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/drivers/net/wireless/libertas_tf/if_usb.c
-+++ b/drivers/net/wireless/libertas_tf/if_usb.c
-@@ -9,11 +9,13 @@
-  */
- #define DRV_NAME "lbtf_usb"
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include "libertas_tf.h"
- #include "if_usb.h"
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/module.h>
- #include <linux/firmware.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_main.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_main.patch
deleted file mode 100644
index 88c9fd3..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_libertas_tf_main.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/libertas_tf/main.c
-+++ b/drivers/net/wireless/libertas_tf/main.c
-@@ -7,8 +7,10 @@
-  *  the Free Software Foundation; either version 2 of the License, or (at
-  *  your option) any later version.
-  */
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/hardirq.h>
- #include <linux/slab.h>
- 
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_rtlwifi_wifi.patch b/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_rtlwifi_wifi.patch
deleted file mode 100644
index bed0b29..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/drivers_net_wireless_rtlwifi_wifi.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/drivers/net/wireless/rtlwifi/wifi.h
-+++ b/drivers/net/wireless/rtlwifi/wifi.h
-@@ -30,8 +30,10 @@
- #ifndef __RTL_WIFI_H__
- #define __RTL_WIFI_H__
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/sched.h>
- #include <linux/firmware.h>
- #include <linux/etherdevice.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/net_bluetooth_lib.patch b/patches/collateral-evolutions/network/53-pr_fmt/net_bluetooth_lib.patch
deleted file mode 100644
index 8492b14..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/net_bluetooth_lib.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/net/bluetooth/lib.c
-+++ b/net/bluetooth/lib.c
-@@ -24,9 +24,11 @@
- 
- /* Bluetooth kernel library. */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "Bluetooth: " fmt
- 
- #include <linux/export.h>
-+#include <linux/printk.h>
- 
- #include <net/bluetooth/bluetooth.h>
- 
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_core.patch b/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_core.patch
deleted file mode 100644
index cc37a50..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_core.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/net/wireless/core.c
-+++ b/net/wireless/core.c
-@@ -4,8 +4,10 @@
-  * Copyright 2006-2010		Johannes Berg <johannes@sipsolutions.net>
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/if.h>
- #include <linux/module.h>
- #include <linux/err.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_lib80211.patch b/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_lib80211.patch
deleted file mode 100644
index 29a3604..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_lib80211.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/net/wireless/lib80211.c
-+++ b/net/wireless/lib80211.c
-@@ -13,8 +13,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/ctype.h>
- #include <linux/ieee80211.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_lib80211_crypt_tkip.patch b/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_lib80211_crypt_tkip.patch
deleted file mode 100644
index a5d56ee..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_lib80211_crypt_tkip.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/net/wireless/lib80211_crypt_tkip.c
-+++ b/net/wireless/lib80211_crypt_tkip.c
-@@ -10,8 +10,10 @@
-  * more details.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/err.h>
- #include <linux/module.h>
- #include <linux/init.h>
diff --git a/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_reg.patch b/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_reg.patch
deleted file mode 100644
index 168b4d1..0000000
--- a/patches/collateral-evolutions/network/53-pr_fmt/net_wireless_reg.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/net/wireless/reg.c
-+++ b/net/wireless/reg.c
-@@ -42,9 +42,11 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/export.h>
- #include <linux/slab.h>
- #include <linux/list.h>
diff --git a/patches/collateral-evolutions/nfc/02-pr_fmt/INFO b/patches/collateral-evolutions/nfc/02-pr_fmt/INFO
deleted file mode 100644
index d7895f4..0000000
--- a/patches/collateral-evolutions/nfc/02-pr_fmt/INFO
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Undef/define/include printk.h for fixing redefinition warnings
-during build.
-
-Patch adapted from compat-wireless tree.
-
diff --git a/patches/collateral-evolutions/nfc/02-pr_fmt/net_nfc.patch b/patches/collateral-evolutions/nfc/02-pr_fmt/net_nfc.patch
deleted file mode 100644
index 94544a3..0000000
--- a/patches/collateral-evolutions/nfc/02-pr_fmt/net_nfc.patch
+++ /dev/null
@@ -1,181 +0,0 @@
---- a/net/nfc/core.c
-+++ b/net/nfc/core.c
-@@ -21,8 +21,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
---- a/net/nfc/hci/command.c
-+++ b/net/nfc/hci/command.c
-@@ -17,8 +17,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "hci: %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/sched.h>
---- a/net/nfc/hci/core.c
-+++ b/net/nfc/hci/core.c
-@@ -17,8 +17,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "hci: %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
---- a/net/nfc/hci/hcp.c
-+++ b/net/nfc/hci/hcp.c
-@@ -17,8 +17,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "hci: %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
---- a/net/nfc/hci/llc_shdlc.c
-+++ b/net/nfc/hci/llc_shdlc.c
-@@ -18,8 +18,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "shdlc: %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/types.h>
- #include <linux/sched.h>
- #include <linux/wait.h>
---- a/net/nfc/llcp/commands.c
-+++ b/net/nfc/llcp/commands.c
-@@ -17,8 +17,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "llcp: %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
---- a/net/nfc/llcp/llcp.c
-+++ b/net/nfc/llcp/llcp.c
-@@ -17,8 +17,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "llcp: %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/list.h>
---- a/net/nfc/llcp/sock.c
-+++ b/net/nfc/llcp/sock.c
-@@ -17,8 +17,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "llcp: %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
---- a/net/nfc/nci/core.c
-+++ b/net/nfc/nci/core.c
-@@ -25,8 +25,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/types.h>
- #include <linux/workqueue.h>
---- a/net/nfc/nci/data.c
-+++ b/net/nfc/nci/data.c
-@@ -21,8 +21,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/types.h>
- #include <linux/interrupt.h>
- #include <linux/wait.h>
---- a/net/nfc/nci/ntf.c
-+++ b/net/nfc/nci/ntf.c
-@@ -25,8 +25,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <linux/types.h>
- #include <linux/interrupt.h>
- #include <linux/bitops.h>
---- a/net/nfc/nci/rsp.c
-+++ b/net/nfc/nci/rsp.c
-@@ -25,7 +25,9 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
-+#include <linux/printk.h>
- 
- #include <linux/types.h>
- #include <linux/interrupt.h>
---- a/net/nfc/netlink.c
-+++ b/net/nfc/netlink.c
-@@ -21,8 +21,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <net/genetlink.h>
- #include <linux/nfc.h>
- #include <linux/slab.h>
---- a/net/nfc/rawsock.c
-+++ b/net/nfc/rawsock.c
-@@ -21,8 +21,10 @@
-  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
- 
-+#include <linux/printk.h>
- #include <net/tcp_states.h>
- #include <linux/nfc.h>
- #include <linux/export.h>
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 16/42] backports: dissolve compat-3.4.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (14 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 15/42] backports: dissolve backport.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 17/42] backports: dissolve compat-3.3.h Johannes Berg
                   ` (28 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This also requires some changes around kconfig.h.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/backport/backport.h   |   1 +
 backport/backport-include/linux/compat-2.6.28.h |   3 -
 backport/backport-include/linux/compat-3.4.h    | 225 ------------------------
 backport/backport-include/linux/compat.h        |  16 ++
 backport/backport-include/linux/etherdevice.h   |  32 ++++
 backport/backport-include/linux/fs.h            |   5 +
 backport/backport-include/linux/i2c-algo-bit.h  |  12 ++
 backport/backport-include/linux/kconfig.h       |  24 +++
 backport/backport-include/linux/mm.h            |  14 ++
 backport/backport-include/linux/pci.h           |  14 ++
 backport/backport-include/linux/poll.h          |  21 +++
 backport/backport-include/linux/regmap.h        |  40 +++++
 backport/backport-include/linux/skbuff.h        |  18 ++
 backport/backport-include/linux/slab.h          |  27 +++
 backport/backport-include/linux/wait.h          |  19 ++
 15 files changed, 243 insertions(+), 228 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-3.4.h
 create mode 100644 backport/backport-include/linux/compat.h
 create mode 100644 backport/backport-include/linux/i2c-algo-bit.h
 create mode 100644 backport/backport-include/linux/kconfig.h
 create mode 100644 backport/backport-include/linux/poll.h
 create mode 100644 backport/backport-include/linux/skbuff.h
 create mode 100644 backport/backport-include/linux/slab.h
 create mode 100644 backport/backport-include/linux/wait.h

diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index 790fe48..7cf21aa 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -1,6 +1,7 @@
 #ifndef __BACKPORT_H
 #define __BACKPORT_H
 #include <backport/autoconf.h>
+#include <linux/kconfig.h>
 
 #ifndef __ASSEMBLY__
 #define LINUX_BACKPORT(__sym) backport_ ##__sym
diff --git a/backport/backport-include/linux/compat-2.6.28.h b/backport/backport-include/linux/compat-2.6.28.h
index 611065b..12b644f 100644
--- a/backport/backport-include/linux/compat-2.6.28.h
+++ b/backport/backport-include/linux/compat-2.6.28.h
@@ -260,9 +260,6 @@ static inline void skb_queue_splice_tail(const struct sk_buff_head *list,
 #define round_jiffies_up LINUX_BACKPORT(round_jiffies_up)
 unsigned long round_jiffies_up(unsigned long j);
 
-extern void v2_6_28_skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
-			    int off, int size);
-
 #define wake_up_interruptible_poll(x, m)			\
 	__wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m))
 
diff --git a/backport/backport-include/linux/compat-3.4.h b/backport/backport-include/linux/compat-3.4.h
deleted file mode 100644
index a152d51..0000000
--- a/backport/backport-include/linux/compat-3.4.h
+++ /dev/null
@@ -1,225 +0,0 @@
-#ifndef LINUX_3_4_COMPAT_H
-#define LINUX_3_4_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
-
-#include <linux/poll.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
-/* need to import it, but it only exists since kernel 3.1 */
-#include <linux/kconfig.h>
-#endif
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-#if defined(CONFIG_REGMAP)
-#include <linux/regmap.h>
-#define devm_regmap_init LINUX_BACKPORT(devm_regmap_init)
-struct regmap *devm_regmap_init(struct device *dev,
-				const struct regmap_bus *bus,
-				const struct regmap_config *config);
-#if defined(CONFIG_REGMAP_I2C)
-#define devm_regmap_init_i2c LINUX_BACKPORT(devm_regmap_init_i2c)
-struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
-				    const struct regmap_config *config);
-#endif /* defined(CONFIG_REGMAP_I2C) */
-#if defined(CONFIG_REGMAP_SPI)
-#define devm_regmap_init_spi LINUX_BACKPORT(devm_regmap_init_spi)
-struct regmap *devm_regmap_init_spi(struct spi_device *dev,
-				    const struct regmap_config *config);
-#endif /* defined(CONFIG_REGMAP_SPI) */
-
-/*
- * We can't backport these unless we try to backport
- * the full regmap into core so warn if used.
- * No drivers are using this yet anyway.
- */
-#define regmap_raw_write_async LINUX_BACKPORT(regmap_raw_write_async)
-static inline int regmap_raw_write_async(struct regmap *map, unsigned int reg,
-					 const void *val, size_t val_len)
-{
-	WARN_ONCE(1, "regmap API is disabled");
-	return -EINVAL;
-}
-
-#define regmap_async_complete LINUX_BACKPORT(regmap_async_complete)
-static inline void regmap_async_complete(struct regmap *map)
-{
-	WARN_ONCE(1, "regmap API is disabled");
-}
-
-#endif /* defined(CONFIG_REGMAP) */
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
-
-/*
- * defined here to allow things to compile but technically
- * using this for memory regions will yield in a no-op on newer
- * kernels but on older kernels (v3.3 and older) this bit was used
- * for VM_ALWAYSDUMP. The goal was to remove this bit moving forward
- * and since we can't skip the core dump on old kernels we just make
- * this bit name now a no-op.
- *
- * For details see commits: 909af7 accb61fe cdaaa7003
- */
-#define VM_NODUMP      0x0
-
-/* This backports:
- *
- * commit 63b2001169e75cd71e917ec953fdab572e3f944a
- * Author: Thomas Gleixner <tglx@linutronix.de>
- * Date:   Thu Dec 1 00:04:00 2011 +0100
-
- * 	sched/wait: Add __wake_up_all_locked() API
- */
-#include <linux/wait.h>
-extern void compat_wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr);
-#define wake_up_all_locked(x)	compat_wake_up_locked((x), TASK_NORMAL, 0)
-
-/* This backports:
- *
- * commit a8203725dfded5c1f79dca3368a4a273e24b59bb
- * Author: Xi Wang <xi.wang@gmail.com>
- * Date:   Mon Mar 5 15:14:41 2012 -0800
- *
- * 	slab: introduce kmalloc_array()
- */
-
-/* SIZE_MAX is backported in compat-3.5.h so include it */
-#include <linux/compat-3.5.h>
-#define kmalloc_array LINUX_BACKPORT(kmalloc_array)
-static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
-{
-	if (size != 0 && n > SIZE_MAX / size)
-		return NULL;
-	return __kmalloc(n * size, flags);
-}
-
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
-#define i2c_bit_algo LINUX_BACKPORT(i2c_bit_algo)
-extern const struct i2c_algorithm i2c_bit_algo;
-#endif
-
-#define simple_open LINUX_BACKPORT(simple_open)
-extern int simple_open(struct inode *inode, struct file *file);
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
-#define skb_add_rx_frag(skb, i, page, off, size, truesize) \
-	v2_6_28_skb_add_rx_frag(skb, i, page, off, size)
-#else
-#define skb_add_rx_frag(skb, i, page, off, size, truesize) \
-	skb_add_rx_frag(skb, i, page, off, size)
-#endif
-
-#ifdef CONFIG_X86_X32_ABI
-#define COMPAT_USE_64BIT_TIME \
-	(!!(task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT))
-#else
-#define COMPAT_USE_64BIT_TIME 0
-#endif
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12))
-#define eth_hw_addr_random LINUX_BACKPORT(eth_hw_addr_random)
-static inline void eth_hw_addr_random(struct net_device *dev)
-{
-#error eth_hw_addr_random() needs to be implemented for < 2.6.12
-}
-#else  /* kernels >= 2.6.12 */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31))
-#define eth_hw_addr_random LINUX_BACKPORT(eth_hw_addr_random)
-static inline void eth_hw_addr_random(struct net_device *dev)
-{
-	get_random_bytes(dev->dev_addr, ETH_ALEN);
-	dev->dev_addr[0] &= 0xfe;       /* clear multicast bit */
-	dev->dev_addr[0] |= 0x02;       /* set local assignment bit (IEEE802) */
-}
-#else /* kernels >= 2.6.31 */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
-/* So this is 2.6.31..2.6.35 */
-
-/* Just have the flags present, they won't really mean anything though */
-#define NET_ADDR_PERM          0       /* address is permanent (default) */
-#define NET_ADDR_RANDOM                1       /* address is generated randomly */
-#define NET_ADDR_STOLEN                2       /* address is stolen from other device */
-
-#define eth_hw_addr_random LINUX_BACKPORT(eth_hw_addr_random)
-static inline void eth_hw_addr_random(struct net_device *dev)
-{
-	random_ether_addr(dev->dev_addr);
-}
-
-#else /* 2.6.36 and on */
-#define eth_hw_addr_random LINUX_BACKPORT(eth_hw_addr_random)
-static inline void eth_hw_addr_random(struct net_device *dev)
-{
-	dev_hw_addr_random(dev, dev->dev_addr);
-}
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)) */
-
-/* source include/linux/pci.h */
-/**
- * module_pci_driver() - Helper macro for registering a PCI driver
- * @__pci_driver: pci_driver struct
- *
- * Helper macro for PCI drivers which do not do anything special in module
- * init/exit. This eliminates a lot of boilerplate. Each module may only
- * use this macro once, and calling it replaces module_init() and module_exit()
- */
-#define module_pci_driver(__pci_driver) \
-	module_driver(__pci_driver, pci_register_driver, \
-		       pci_unregister_driver)
-
-/*
- * Getting something that works in C and CPP for an arg that may or may
- * not be defined is tricky.  Here, if we have "#define CONFIG_BOOGER 1"
- * we match on the placeholder define, insert the "0," for arg1 and generate
- * the triplet (0, 1, 0).  Then the last step cherry picks the 2nd arg (a one).
- * When CONFIG_BOOGER is not defined, we generate a (... 1, 0) pair, and when
- * the last step cherry picks the 2nd arg, we get a zero.
- */
-#define __ARG_PLACEHOLDER_1 0,
-#define config_enabled(cfg) _config_enabled(cfg)
-#define _config_enabled(value) __config_enabled(__ARG_PLACEHOLDER_##value)
-#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0)
-#define ___config_enabled(__ignored, val, ...) val
-
-/* 3.1 - 3.3 had a broken version of this, so undef */
-#undef IS_ENABLED
-#define IS_ENABLED(option) \
-        (config_enabled(option) || config_enabled(option##_MODULE))
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
-/*
- * Return true if it is guaranteed that poll will not wait. This is the case
- * if the poll() of another file descriptor in the set got an event, so there
- * is no need for waiting.
- */
-#define poll_does_not_wait LINUX_BACKPORT(poll_does_not_wait)
-static inline bool poll_does_not_wait(const poll_table *p)
-{
-	return p == NULL || p->qproc == NULL;
-}
-
-/*
- * Return the set of events that the application wants to poll for.
- * This is useful for drivers that need to know whether a DMA transfer has
- * to be started implicitly on poll(). You typically only want to do that
- * if the application is actually polling for POLLIN and/or POLLOUT.
- */
-#define poll_requested_events LINUX_BACKPORT(poll_requested_events)
-static inline unsigned long poll_requested_events(const poll_table *p)
-{
-	return p ? p->key : ~0UL;
-}
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)) */
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
-
-#endif /* LINUX_5_4_COMPAT_H */
diff --git a/backport/backport-include/linux/compat.h b/backport/backport-include/linux/compat.h
new file mode 100644
index 0000000..22db9b0
--- /dev/null
+++ b/backport/backport-include/linux/compat.h
@@ -0,0 +1,16 @@
+#ifndef __BACKPORT_COMPAT_H
+#define __BACKPORT_COMPAT_H
+
+#include_next <linux/compat.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+#ifdef CONFIG_X86_X32_ABI
+#define COMPAT_USE_64BIT_TIME \
+	(!!(task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT))
+#else
+#define COMPAT_USE_64BIT_TIME 0
+#endif
+#endif
+
+#endif /* __BACKPORT_COMPAT_H */
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index aba5e67..bbabfbd 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -3,6 +3,38 @@
 #include_next <linux/etherdevice.h>
 #include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+#error eth_hw_addr_random() needs to be implemented for < 2.6.12
+}
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+	get_random_bytes(dev->dev_addr, ETH_ALEN);
+	dev->dev_addr[0] &= 0xfe;       /* clear multicast bit */
+	dev->dev_addr[0] |= 0x02;       /* set local assignment bit (IEEE802) */
+}
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+/* So this is 2.6.31..2.6.35 */
+
+/* Just have the flags present, they won't really mean anything though */
+#define NET_ADDR_PERM		0	/* address is permanent (default) */
+#define NET_ADDR_RANDOM		1	/* address is generated randomly */
+#define NET_ADDR_STOLEN		2	/* address is stolen from other device */
+
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+	random_ether_addr(dev->dev_addr);
+}
+
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+	dev_hw_addr_random(dev, dev->dev_addr);
+}
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
 #include <linux/random.h>
 /**
diff --git a/backport/backport-include/linux/fs.h b/backport/backport-include/linux/fs.h
index 746c7d1..b441236 100644
--- a/backport/backport-include/linux/fs.h
+++ b/backport/backport-include/linux/fs.h
@@ -8,6 +8,11 @@
  */
 #include <linux/uidgid.h>
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+#define simple_open LINUX_BACKPORT(simple_open)
+extern int simple_open(struct inode *inode, struct file *file);
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
 /**
  * backport of:
diff --git a/backport/backport-include/linux/i2c-algo-bit.h b/backport/backport-include/linux/i2c-algo-bit.h
new file mode 100644
index 0000000..643e0c7
--- /dev/null
+++ b/backport/backport-include/linux/i2c-algo-bit.h
@@ -0,0 +1,12 @@
+#ifndef __BACKPORT_LINUX_I2C_ALGO_BIT_H
+#define __BACKPORT_LINUX_I2C_ALGO_BIT_H
+#include_next <linux/i2c-algo-bit.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)
+#define i2c_bit_algo LINUX_BACKPORT(i2c_bit_algo)
+extern const struct i2c_algorithm i2c_bit_algo;
+#endif
+
+#endif /* __BACKPORT_LINUX_I2C_ALGO_BIT_H */
diff --git a/backport/backport-include/linux/kconfig.h b/backport/backport-include/linux/kconfig.h
new file mode 100644
index 0000000..d5c483d
--- /dev/null
+++ b/backport/backport-include/linux/kconfig.h
@@ -0,0 +1,24 @@
+#ifndef __BACKPORT_LINUX_KCONFIG_H
+#define __BACKPORT_LINUX_KCONFIG_H
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
+#include_next <linux/kconfig.h>
+#endif
+
+#ifndef __ARG_PLACEHOLDER_1
+#define __ARG_PLACEHOLDER_1 0,
+#define config_enabled(cfg) _config_enabled(cfg)
+#define _config_enabled(value) __config_enabled(__ARG_PLACEHOLDER_##value)
+#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0)
+#define ___config_enabled(__ignored, val, ...) val
+
+/*
+ * 3.1 - 3.3 had a broken version of this, so undef
+ * (they didn't have __ARG_PLACEHOLDER_1)
+ */
+#undef IS_ENABLED
+#define IS_ENABLED(option) \
+        (config_enabled(option) || config_enabled(option##_MODULE))
+#endif
+
+#endif
diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
index bfb771c..9ba1f00 100644
--- a/backport/backport-include/linux/mm.h
+++ b/backport/backport-include/linux/mm.h
@@ -2,6 +2,20 @@
 #define __BACKPORT_MM_H
 #include_next <linux/mm.h>
 
+#ifndef VM_NODUMP
+/*
+ * defined here to allow things to compile but technically
+ * using this for memory regions will yield in a no-op on newer
+ * kernels but on older kernels (v3.3 and older) this bit was used
+ * for VM_ALWAYSDUMP. The goal was to remove this bit moving forward
+ * and since we can't skip the core dump on old kernels we just make
+ * this bit name now a no-op.
+ *
+ * For details see commits: 909af7 accb61fe cdaaa7003
+ */
+#define VM_NODUMP      0x0
+#endif
+
 #ifndef VM_DONTDUMP
 #define VM_DONTDUMP    VM_NODUMP
 #endif
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index 58f539f..eb985f1 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -12,6 +12,20 @@ int __must_check pci_enable_device_mem(struct pci_dev *dev);
 	const struct pci_device_id _table[] __devinitdata
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
+/**
+ * module_pci_driver() - Helper macro for registering a PCI driver
+ * @__pci_driver: pci_driver struct
+ *
+ * Helper macro for PCI drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only
+ * use this macro once, and calling it replaces module_init() and module_exit()
+ */
+#define module_pci_driver(__pci_driver) \
+	module_driver(__pci_driver, pci_register_driver, \
+		       pci_unregister_driver)
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
 #define pcie_capability_read_word LINUX_BACKPORT(pcie_capability_read_word)
 int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val);
diff --git a/backport/backport-include/linux/poll.h b/backport/backport-include/linux/poll.h
new file mode 100644
index 0000000..978b95c
--- /dev/null
+++ b/backport/backport-include/linux/poll.h
@@ -0,0 +1,21 @@
+#ifndef __BACKPORT_LINUX_POLL_H
+#define __BACKPORT_LINUX_POLL_H
+#include_next <linux/poll.h>
+#include <linux/version.h>
+
+#if  LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) && \
+     LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+#define poll_does_not_wait LINUX_BACKPORT(poll_does_not_wait)
+static inline bool poll_does_not_wait(const poll_table *p)
+{
+	return p == NULL || p->qproc == NULL;
+}
+
+#define poll_requested_events LINUX_BACKPORT(poll_requested_events)
+static inline unsigned long poll_requested_events(const poll_table *p)
+{
+	return p ? p->key : ~0UL;
+}
+#endif /* 2.6.31 <= version < 3.4 */
+
+#endif /* __BACKPORT_LINUX_POLL_H */
diff --git a/backport/backport-include/linux/regmap.h b/backport/backport-include/linux/regmap.h
index fff8e46..ac6a3f2 100644
--- a/backport/backport-include/linux/regmap.h
+++ b/backport/backport-include/linux/regmap.h
@@ -13,4 +13,44 @@ struct regmap *dev_get_regmap(struct device *dev, const char *name)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+#if defined(CONFIG_REGMAP)
+#define devm_regmap_init LINUX_BACKPORT(devm_regmap_init)
+struct regmap *devm_regmap_init(struct device *dev,
+				const struct regmap_bus *bus,
+				const struct regmap_config *config);
+#if defined(CONFIG_REGMAP_I2C)
+#define devm_regmap_init_i2c LINUX_BACKPORT(devm_regmap_init_i2c)
+struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
+				    const struct regmap_config *config);
+#endif /* defined(CONFIG_REGMAP_I2C) */
+#if defined(CONFIG_REGMAP_SPI)
+#define devm_regmap_init_spi LINUX_BACKPORT(devm_regmap_init_spi)
+struct regmap *devm_regmap_init_spi(struct spi_device *dev,
+				    const struct regmap_config *config);
+#endif /* defined(CONFIG_REGMAP_SPI) */
+
+/*
+ * We can't backport these unless we try to backport
+ * the full regmap into core so warn if used.
+ * No drivers are using this yet anyway.
+ */
+#define regmap_raw_write_async LINUX_BACKPORT(regmap_raw_write_async)
+static inline int regmap_raw_write_async(struct regmap *map, unsigned int reg,
+					 const void *val, size_t val_len)
+{
+	WARN_ONCE(1, "regmap API is disabled");
+	return -EINVAL;
+}
+
+#define regmap_async_complete LINUX_BACKPORT(regmap_async_complete)
+static inline void regmap_async_complete(struct regmap *map)
+{
+	WARN_ONCE(1, "regmap API is disabled");
+}
+
+#endif /* defined(CONFIG_REGMAP) */
+#endif /* 3.2 <= version < 3.4 */
+
 #endif /* __BACKPORT_LINUX_REGMAP_H */
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
new file mode 100644
index 0000000..37c622c
--- /dev/null
+++ b/backport/backport-include/linux/skbuff.h
@@ -0,0 +1,18 @@
+#ifndef __BACKPORT_SKBUFF_H
+#define __BACKPORT_SKBUFF_H
+#include_next <linux/skbuff.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
+extern void v2_6_28_skb_add_rx_frag(struct sk_buff *skb, int i,
+				    struct page *page,
+				    int off, int size);
+
+#define skb_add_rx_frag(skb, i, page, off, size, truesize) \
+	v2_6_28_skb_add_rx_frag(skb, i, page, off, size)
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+#define skb_add_rx_frag(skb, i, page, off, size, truesize) \
+	skb_add_rx_frag(skb, i, page, off, size)
+#endif
+
+#endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/slab.h b/backport/backport-include/linux/slab.h
new file mode 100644
index 0000000..850020b
--- /dev/null
+++ b/backport/backport-include/linux/slab.h
@@ -0,0 +1,27 @@
+#ifndef __BACKPORT_SLAB_H
+#define __BACKPORT_SLAB_H
+#include_next <linux/slab.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
+/* This backports:
+ *
+ * commit a8203725dfded5c1f79dca3368a4a273e24b59bb
+ * Author: Xi Wang <xi.wang@gmail.com>
+ * Date:   Mon Mar 5 15:14:41 2012 -0800
+ *
+ * 	slab: introduce kmalloc_array()
+ */
+
+#include <linux/kernel.h> /* for SIZE_MAX */
+
+#define kmalloc_array LINUX_BACKPORT(kmalloc_array)
+static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
+{
+	if (size != 0 && n > SIZE_MAX / size)
+		return NULL;
+	return __kmalloc(n * size, flags);
+}
+#endif
+
+#endif /* __BACKPORT_SLAB_H */
diff --git a/backport/backport-include/linux/wait.h b/backport/backport-include/linux/wait.h
new file mode 100644
index 0000000..9549984
--- /dev/null
+++ b/backport/backport-include/linux/wait.h
@@ -0,0 +1,19 @@
+#ifndef __BACKPORT_LINUX_WAIT_H
+#define __BACKPORT_LINUX_WAIT_H
+#include_next <linux/wait.h>
+
+/* This backports:
+ *
+ * commit 63b2001169e75cd71e917ec953fdab572e3f944a
+ * Author: Thomas Gleixner <tglx@linutronix.de>
+ * Date:   Thu Dec 1 00:04:00 2011 +0100
+ *
+ * 	sched/wait: Add __wake_up_all_locked() API
+ */
+
+#ifndef wake_up_all_locked
+extern void compat_wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr);
+#define wake_up_all_locked(x)	compat_wake_up_locked((x), TASK_NORMAL, 0)
+#endif
+
+#endif /* __BACKPORT_LINUX_WAIT_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 17/42] backports: dissolve compat-3.3.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (15 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 16/42] backports: dissolve compat-3.4.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 18/42] backports: dissolve compat-3.2.h Johannes Berg
                   ` (27 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-3.3.h      | 397 ----------------------
 backport/backport-include/linux/device.h          |  23 ++
 backport/backport-include/linux/ethtool.h         |  17 +
 backport/backport-include/linux/i2c.h             |  14 +
 backport/backport-include/linux/mii.h             | 147 ++++++++
 backport/backport-include/linux/netdev_features.h |  15 +
 backport/backport-include/linux/netdevice.h       |  45 +++
 backport/backport-include/linux/nl80211.h         |  10 +
 backport/backport-include/linux/pci_regs.h        |  18 +
 backport/backport-include/linux/skbuff.h          |  11 +
 backport/backport-include/linux/usb.h             |  14 +
 backport/backport-include/net/sch_generic.h       |  25 ++
 12 files changed, 339 insertions(+), 397 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-3.3.h
 create mode 100644 backport/backport-include/linux/ethtool.h
 create mode 100644 backport/backport-include/linux/mii.h
 create mode 100644 backport/backport-include/linux/netdev_features.h
 create mode 100644 backport/backport-include/linux/nl80211.h
 create mode 100644 backport/backport-include/net/sch_generic.h

diff --git a/backport/backport-include/linux/compat-3.3.h b/backport/backport-include/linux/compat-3.3.h
deleted file mode 100644
index ce7e776..0000000
--- a/backport/backport-include/linux/compat-3.3.h
+++ /dev/null
@@ -1,397 +0,0 @@
-#ifndef LINUX_3_3_COMPAT_H
-#define LINUX_3_3_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
-
-#include <linux/pci_regs.h>
-
-/* include to override NL80211_FEATURE_SK_TX_STATUS */
-#include <linux/nl80211.h>
-#include <linux/skbuff.h>
-#include <net/sch_generic.h>
-#include <linux/mii.h>
-#include <linux/netdevice.h>
-
-/*
- * BQL was added as of v3.3 but some Linux distributions
- * have backported BQL to their v3.2 kernels or older. To
- * address this we assume that they also enabled CONFIG_BQL
- * and test for that here and simply avoid adding the static
- * inlines if it was defined
- */
-#ifndef CONFIG_BQL
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
-static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
-					unsigned int bytes)
-{
-}
-#endif
-
-static inline void netdev_sent_queue(struct net_device *dev, unsigned int bytes)
-{
-}
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
-static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
-					     unsigned pkts, unsigned bytes)
-{
-}
-#endif
-
-static inline void netdev_completed_queue(struct net_device *dev,
-					  unsigned pkts, unsigned bytes)
-{
-}
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
-static inline void netdev_tx_reset_queue(struct netdev_queue *q)
-{
-}
-#endif
-
-static inline void netdev_reset_queue(struct net_device *dev_queue)
-{
-}
-#endif /* CONFIG_BQL */
-
-
-#define ethtool_adv_to_mii_adv_t LINUX_BACKPORT(ethtool_adv_to_mii_adv_t)
-
-/**
- * ethtool_adv_to_mii_adv_t
- * @ethadv: the ethtool advertisement settings
- *
- * A small helper function that translates ethtool advertisement
- * settings to phy autonegotiation advertisements for the
- * MII_ADVERTISE register.
- */
-static inline u32 ethtool_adv_to_mii_adv_t(u32 ethadv)
-{
-	u32 result = 0;
-
-	if (ethadv & ADVERTISED_10baseT_Half)
-		result |= ADVERTISE_10HALF;
-	if (ethadv & ADVERTISED_10baseT_Full)
-		result |= ADVERTISE_10FULL;
-	if (ethadv & ADVERTISED_100baseT_Half)
-		result |= ADVERTISE_100HALF;
-	if (ethadv & ADVERTISED_100baseT_Full)
-		result |= ADVERTISE_100FULL;
-	if (ethadv & ADVERTISED_Pause)
-		result |= ADVERTISE_PAUSE_CAP;
-	if (ethadv & ADVERTISED_Asym_Pause)
-		result |= ADVERTISE_PAUSE_ASYM;
-
-	return result;
-}
-
-#define mii_adv_to_ethtool_adv_t LINUX_BACKPORT(mii_adv_to_ethtool_adv_t)
-
-/**
- * mii_adv_to_ethtool_adv_t
- * @adv: value of the MII_ADVERTISE register
- *
- * A small helper function that translates MII_ADVERTISE bits
- * to ethtool advertisement settings.
- */
-static inline u32 mii_adv_to_ethtool_adv_t(u32 adv)
-{
-	u32 result = 0;
-
-	if (adv & ADVERTISE_10HALF)
-		result |= ADVERTISED_10baseT_Half;
-	if (adv & ADVERTISE_10FULL)
-		result |= ADVERTISED_10baseT_Full;
-	if (adv & ADVERTISE_100HALF)
-		result |= ADVERTISED_100baseT_Half;
-	if (adv & ADVERTISE_100FULL)
-		result |= ADVERTISED_100baseT_Full;
-	if (adv & ADVERTISE_PAUSE_CAP)
-		result |= ADVERTISED_Pause;
-	if (adv & ADVERTISE_PAUSE_ASYM)
-		result |= ADVERTISED_Asym_Pause;
-
-	return result;
-}
-
-#define ethtool_adv_to_mii_ctrl1000_t LINUX_BACKPORT(ethtool_adv_to_mii_ctrl1000_t)
-
-/**
- * ethtool_adv_to_mii_ctrl1000_t
- * @ethadv: the ethtool advertisement settings
- *
- * A small helper function that translates ethtool advertisement
- * settings to phy autonegotiation advertisements for the
- * MII_CTRL1000 register when in 1000T mode.
- */
-static inline u32 ethtool_adv_to_mii_ctrl1000_t(u32 ethadv)
-{
-	u32 result = 0;
-
-	if (ethadv & ADVERTISED_1000baseT_Half)
-		result |= ADVERTISE_1000HALF;
-	if (ethadv & ADVERTISED_1000baseT_Full)
-		result |= ADVERTISE_1000FULL;
-
-	return result;
-}
-
-#define mii_ctrl1000_to_ethtool_adv_t LINUX_BACKPORT(mii_ctrl1000_to_ethtool_adv_t)
-
-/**
- * mii_ctrl1000_to_ethtool_adv_t
- * @adv: value of the MII_CTRL1000 register
- *
- * A small helper function that translates MII_CTRL1000
- * bits, when in 1000Base-T mode, to ethtool
- * advertisement settings.
- */
-static inline u32 mii_ctrl1000_to_ethtool_adv_t(u32 adv)
-{
-	u32 result = 0;
-
-	if (adv & ADVERTISE_1000HALF)
-		result |= ADVERTISED_1000baseT_Half;
-	if (adv & ADVERTISE_1000FULL)
-		result |= ADVERTISED_1000baseT_Full;
-
-	return result;
-}
-
-#define mii_lpa_to_ethtool_lpa_t LINUX_BACKPORT(mii_lpa_to_ethtool_lpa_t)
-
-/**
- * mii_lpa_to_ethtool_lpa_t
- * @adv: value of the MII_LPA register
- *
- * A small helper function that translates MII_LPA
- * bits, when in 1000Base-T mode, to ethtool
- * LP advertisement settings.
- */
-static inline u32 mii_lpa_to_ethtool_lpa_t(u32 lpa)
-{
-	u32 result = 0;
-
-	if (lpa & LPA_LPACK)
-		result |= ADVERTISED_Autoneg;
-
-	return result | mii_adv_to_ethtool_adv_t(lpa);
-}
-
-#define mii_stat1000_to_ethtool_lpa_t LINUX_BACKPORT(mii_stat1000_to_ethtool_lpa_t)
-
-/**
- * mii_stat1000_to_ethtool_lpa_t
- * @adv: value of the MII_STAT1000 register
- *
- * A small helper function that translates MII_STAT1000
- * bits, when in 1000Base-T mode, to ethtool
- * advertisement settings.
- */
-static inline u32 mii_stat1000_to_ethtool_lpa_t(u32 lpa)
-{
-	u32 result = 0;
-
-	if (lpa & LPA_1000HALF)
-		result |= ADVERTISED_1000baseT_Half;
-	if (lpa & LPA_1000FULL)
-		result |= ADVERTISED_1000baseT_Full;
-
-	return result;
-}
-
-#define ethtool_adv_to_mii_adv_x LINUX_BACKPORT(ethtool_adv_to_mii_adv_x)
-/**
- * ethtool_adv_to_mii_adv_x
- * @ethadv: the ethtool advertisement settings
- *
- * A small helper function that translates ethtool advertisement
- * settings to phy autonegotiation advertisements for the
- * MII_CTRL1000 register when in 1000Base-X mode.
- */
-static inline u32 ethtool_adv_to_mii_adv_x(u32 ethadv)
-{
-	u32 result = 0;
-
-	if (ethadv & ADVERTISED_1000baseT_Half)
-		result |= ADVERTISE_1000XHALF;
-	if (ethadv & ADVERTISED_1000baseT_Full)
-		result |= ADVERTISE_1000XFULL;
-	if (ethadv & ADVERTISED_Pause)
-		result |= ADVERTISE_1000XPAUSE;
-	if (ethadv & ADVERTISED_Asym_Pause)
-		result |= ADVERTISE_1000XPSE_ASYM;
-
-	return result;
-}
-
-#define mii_adv_to_ethtool_adv_x LINUX_BACKPORT(mii_adv_to_ethtool_adv_x)
-
-/**
- * mii_adv_to_ethtool_adv_x
- * @adv: value of the MII_CTRL1000 register
- *
- * A small helper function that translates MII_CTRL1000
- * bits, when in 1000Base-X mode, to ethtool
- * advertisement settings.
- */
-static inline u32 mii_adv_to_ethtool_adv_x(u32 adv)
-{
-	u32 result = 0;
-
-	if (adv & ADVERTISE_1000XHALF)
-		result |= ADVERTISED_1000baseT_Half;
-	if (adv & ADVERTISE_1000XFULL)
-		result |= ADVERTISED_1000baseT_Full;
-	if (adv & ADVERTISE_1000XPAUSE)
-		result |= ADVERTISED_Pause;
-	if (adv & ADVERTISE_1000XPSE_ASYM)
-		result |= ADVERTISED_Asym_Pause;
-
-	return result;
-}
-
-#define mii_lpa_to_ethtool_lpa_x LINUX_BACKPORT(mii_lpa_to_ethtool_lpa_x)
-
-/**
- * mii_lpa_to_ethtool_lpa_x
- * @adv: value of the MII_LPA register
- *
- * A small helper function that translates MII_LPA
- * bits, when in 1000Base-X mode, to ethtool
- * LP advertisement settings.
- */
-static inline u32 mii_lpa_to_ethtool_lpa_x(u32 lpa)
-{
-	u32 result = 0;
-
-	if (lpa & LPA_LPACK)
-		result |= ADVERTISED_Autoneg;
-
-	return result | mii_adv_to_ethtool_adv_x(lpa);
-}
-
-/**
- * ethtool_rxfh_indir_default - get default value for RX flow hash indirection
- * @index: Index in RX flow hash indirection table
- * @n_rx_rings: Number of RX rings to use
- *
- * This function provides the default policy for RX flow hash indirection.
- */
-static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
-{
-	return index % n_rx_rings;
-}
-
-#define ETHTOOL_FWVERS_LEN	32
-
-#if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,9) && LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,23) && LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)))
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37))
-/* mask qdisc_cb_private_validate as RHEL6 backports this */
-#define qdisc_cb_private_validate(a,b) compat_qdisc_cb_private_validate(a,b)
-static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
-{
-	BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct qdisc_skb_cb) + sz);
-}
-#else
-/* mask qdisc_cb_private_validate as RHEL6 backports this */
-#define qdisc_cb_private_validate(a,b) compat_qdisc_cb_private_validate(a,b)
-static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
-{
-	/* XXX ? */
-}
-#endif
-#endif
-
-#define __pskb_copy LINUX_BACKPORT(__pskb_copy)
-extern struct sk_buff *__pskb_copy(struct sk_buff *skb,
-				   int headroom, gfp_t gfp_mask);
-
-static inline void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
-{
-	WARN_ON(1);
-}
-#define NL80211_FEATURE_SK_TX_STATUS 0
-
-typedef u32 netdev_features_t;
-
-/* source include/linux/device.h */
-/**
- * module_driver() - Helper macro for drivers that don't do anything
- * special in module init/exit. This eliminates a lot of boilerplate.
- * Each module may only use this macro once, and calling it replaces
- * module_init() and module_exit().
- *
- * Use this macro to construct bus specific macros for registering
- * drivers, and do not use it on its own.
- */
-#define module_driver(__driver, __register, __unregister) \
-static int __init __driver##_init(void) \
-{ \
-	return __register(&(__driver)); \
-} \
-module_init(__driver##_init); \
-static void __exit __driver##_exit(void) \
-{ \
-	__unregister(&(__driver)); \
-} \
-module_exit(__driver##_exit);
-
-/* source include/linux/usb.h */
-/**
- * module_usb_driver() - Helper macro for registering a USB driver
- * @__usb_driver: usb_driver struct
- *
- * Helper macro for USB drivers which do not do anything special in module
- * init/exit. This eliminates a lot of boilerplate. Each module may only
- * use this macro once, and calling it replaces module_init() and module_exit()
- */
-#define module_usb_driver(__usb_driver) \
-	module_driver(__usb_driver, usb_register, \
-		       usb_deregister)
-
-
-/*
- * PCI_EXP_TYPE_RC_EC was added via 1b6b8ce2 on v2.6.30-rc4~20 :
- *
- * mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 1b6b8ce2
- * v2.6.30-rc4~20^2
- *
- * but the fix for its definition was merged on v3.3-rc1~101^2~67
- *
- * mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 1830ea91
- * v3.3-rc1~101^2~67
- *
- * while we can assume it got merged and backported on v3.2.28 (which it did
- * see c1c3cd9) we cannot assume every kernel has it fixed so lets just undef
- * it here and redefine it.
- */
-#undef PCI_EXP_TYPE_RC_EC
-#define  PCI_EXP_TYPE_RC_EC    0xa     /* Root Complex Event Collector */
-
-
-/* This backports:
- *
- * commit 7c92784a546d2945b6d6973a30f7134be78eb7a4
- * Author: Lars-Peter Clausen <lars@metafoo.de>
- * Date:   Wed Nov 16 10:13:36 2011 +0100
- *
- *     I2C: Add helper macro for i2c_driver boilerplate
- */
-/**
- * module_i2c_driver() - Helper macro for registering a I2C driver
- * @__i2c_driver: i2c_driver struct
- *
- * Helper macro for I2C drivers which do not do anything special in module
- * init/exit. This eliminates a lot of boilerplate. Each module may only
- * use this macro once, and calling it replaces module_init() and module_exit()
- */
-#define module_i2c_driver(__i2c_driver) \
-	module_driver(__i2c_driver, i2c_add_driver, \
-			i2c_del_driver)
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
-
-#endif /* LINUX_3_3_COMPAT_H */
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 872d704..54940ed 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -14,6 +14,29 @@
 	dev_printk(KERN_CRIT , dev , format , ## arg)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+/**
+ * module_driver() - Helper macro for drivers that don't do anything
+ * special in module init/exit. This eliminates a lot of boilerplate.
+ * Each module may only use this macro once, and calling it replaces
+ * module_init() and module_exit().
+ *
+ * Use this macro to construct bus specific macros for registering
+ * drivers, and do not use it on its own.
+ */
+#define module_driver(__driver, __register, __unregister) \
+static int __init __driver##_init(void) \
+{ \
+	return __register(&(__driver)); \
+} \
+module_init(__driver##_init); \
+static void __exit __driver##_exit(void) \
+{ \
+	__unregister(&(__driver)); \
+} \
+module_exit(__driver##_exit);
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
 #define devm_ioremap_resource LINUX_BACKPORT(devm_ioremap_resource)
 void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
diff --git a/backport/backport-include/linux/ethtool.h b/backport/backport-include/linux/ethtool.h
new file mode 100644
index 0000000..2236d0e
--- /dev/null
+++ b/backport/backport-include/linux/ethtool.h
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_LINUX_ETHTOOL_H
+#define __BACKPORT_LINUX_ETHTOOL_H
+#include_next <linux/ethtool.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
+{
+	return index % n_rx_rings;
+}
+#endif
+
+#ifndef ETHTOOL_FWVERS_LEN
+#define ETHTOOL_FWVERS_LEN 32
+#endif
+
+#endif /* __BACKPORT_LINUX_ETHTOOL_H */
diff --git a/backport/backport-include/linux/i2c.h b/backport/backport-include/linux/i2c.h
index 1cbbd2f..ffa9027 100644
--- a/backport/backport-include/linux/i2c.h
+++ b/backport/backport-include/linux/i2c.h
@@ -24,4 +24,18 @@ extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 #define I2C_FUNC_NOSTART 0x00000010 /* I2C_M_NOSTART */
 #endif
 
+/* This backports:
+ *
+ * commit 7c92784a546d2945b6d6973a30f7134be78eb7a4
+ * Author: Lars-Peter Clausen <lars@metafoo.de>
+ * Date:   Wed Nov 16 10:13:36 2011 +0100
+ *
+ *     I2C: Add helper macro for i2c_driver boilerplate
+ */
+#ifndef module_i2c_driver
+#define module_i2c_driver(__i2c_driver) \
+	module_driver(__i2c_driver, i2c_add_driver, \
+			i2c_del_driver)
+#endif
+
 #endif /* __BACKPORT_LINUX_I2C_H */
diff --git a/backport/backport-include/linux/mii.h b/backport/backport-include/linux/mii.h
new file mode 100644
index 0000000..9ce5700
--- /dev/null
+++ b/backport/backport-include/linux/mii.h
@@ -0,0 +1,147 @@
+#ifndef __BACKPORT_LINUX_MII_H
+#define __BACKPORT_LINUX_MII_H
+#include_next <linux/mii.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+#include <linux/ethtool.h>
+
+#define ethtool_adv_to_mii_adv_t LINUX_BACKPORT(ethtool_adv_to_mii_adv_t)
+static inline u32 ethtool_adv_to_mii_adv_t(u32 ethadv)
+{
+	u32 result = 0;
+
+	if (ethadv & ADVERTISED_10baseT_Half)
+		result |= ADVERTISE_10HALF;
+	if (ethadv & ADVERTISED_10baseT_Full)
+		result |= ADVERTISE_10FULL;
+	if (ethadv & ADVERTISED_100baseT_Half)
+		result |= ADVERTISE_100HALF;
+	if (ethadv & ADVERTISED_100baseT_Full)
+		result |= ADVERTISE_100FULL;
+	if (ethadv & ADVERTISED_Pause)
+		result |= ADVERTISE_PAUSE_CAP;
+	if (ethadv & ADVERTISED_Asym_Pause)
+		result |= ADVERTISE_PAUSE_ASYM;
+
+	return result;
+}
+
+#define mii_adv_to_ethtool_adv_t LINUX_BACKPORT(mii_adv_to_ethtool_adv_t)
+static inline u32 mii_adv_to_ethtool_adv_t(u32 adv)
+{
+	u32 result = 0;
+
+	if (adv & ADVERTISE_10HALF)
+		result |= ADVERTISED_10baseT_Half;
+	if (adv & ADVERTISE_10FULL)
+		result |= ADVERTISED_10baseT_Full;
+	if (adv & ADVERTISE_100HALF)
+		result |= ADVERTISED_100baseT_Half;
+	if (adv & ADVERTISE_100FULL)
+		result |= ADVERTISED_100baseT_Full;
+	if (adv & ADVERTISE_PAUSE_CAP)
+		result |= ADVERTISED_Pause;
+	if (adv & ADVERTISE_PAUSE_ASYM)
+		result |= ADVERTISED_Asym_Pause;
+
+	return result;
+}
+
+#define ethtool_adv_to_mii_ctrl1000_t LINUX_BACKPORT(ethtool_adv_to_mii_ctrl1000_t)
+static inline u32 ethtool_adv_to_mii_ctrl1000_t(u32 ethadv)
+{
+	u32 result = 0;
+
+	if (ethadv & ADVERTISED_1000baseT_Half)
+		result |= ADVERTISE_1000HALF;
+	if (ethadv & ADVERTISED_1000baseT_Full)
+		result |= ADVERTISE_1000FULL;
+
+	return result;
+}
+
+#define mii_ctrl1000_to_ethtool_adv_t LINUX_BACKPORT(mii_ctrl1000_to_ethtool_adv_t)
+static inline u32 mii_ctrl1000_to_ethtool_adv_t(u32 adv)
+{
+	u32 result = 0;
+
+	if (adv & ADVERTISE_1000HALF)
+		result |= ADVERTISED_1000baseT_Half;
+	if (adv & ADVERTISE_1000FULL)
+		result |= ADVERTISED_1000baseT_Full;
+
+	return result;
+}
+
+#define mii_lpa_to_ethtool_lpa_t LINUX_BACKPORT(mii_lpa_to_ethtool_lpa_t)
+static inline u32 mii_lpa_to_ethtool_lpa_t(u32 lpa)
+{
+	u32 result = 0;
+
+	if (lpa & LPA_LPACK)
+		result |= ADVERTISED_Autoneg;
+
+	return result | mii_adv_to_ethtool_adv_t(lpa);
+}
+
+#define mii_stat1000_to_ethtool_lpa_t LINUX_BACKPORT(mii_stat1000_to_ethtool_lpa_t)
+static inline u32 mii_stat1000_to_ethtool_lpa_t(u32 lpa)
+{
+	u32 result = 0;
+
+	if (lpa & LPA_1000HALF)
+		result |= ADVERTISED_1000baseT_Half;
+	if (lpa & LPA_1000FULL)
+		result |= ADVERTISED_1000baseT_Full;
+
+	return result;
+}
+
+#define ethtool_adv_to_mii_adv_x LINUX_BACKPORT(ethtool_adv_to_mii_adv_x)
+static inline u32 ethtool_adv_to_mii_adv_x(u32 ethadv)
+{
+	u32 result = 0;
+
+	if (ethadv & ADVERTISED_1000baseT_Half)
+		result |= ADVERTISE_1000XHALF;
+	if (ethadv & ADVERTISED_1000baseT_Full)
+		result |= ADVERTISE_1000XFULL;
+	if (ethadv & ADVERTISED_Pause)
+		result |= ADVERTISE_1000XPAUSE;
+	if (ethadv & ADVERTISED_Asym_Pause)
+		result |= ADVERTISE_1000XPSE_ASYM;
+
+	return result;
+}
+
+#define mii_adv_to_ethtool_adv_x LINUX_BACKPORT(mii_adv_to_ethtool_adv_x)
+static inline u32 mii_adv_to_ethtool_adv_x(u32 adv)
+{
+	u32 result = 0;
+
+	if (adv & ADVERTISE_1000XHALF)
+		result |= ADVERTISED_1000baseT_Half;
+	if (adv & ADVERTISE_1000XFULL)
+		result |= ADVERTISED_1000baseT_Full;
+	if (adv & ADVERTISE_1000XPAUSE)
+		result |= ADVERTISED_Pause;
+	if (adv & ADVERTISE_1000XPSE_ASYM)
+		result |= ADVERTISED_Asym_Pause;
+
+	return result;
+}
+
+#define mii_lpa_to_ethtool_lpa_x LINUX_BACKPORT(mii_lpa_to_ethtool_lpa_x)
+static inline u32 mii_lpa_to_ethtool_lpa_x(u32 lpa)
+{
+	u32 result = 0;
+
+	if (lpa & LPA_LPACK)
+		result |= ADVERTISED_Autoneg;
+
+	return result | mii_adv_to_ethtool_adv_x(lpa);
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_MII_H */
diff --git a/backport/backport-include/linux/netdev_features.h b/backport/backport-include/linux/netdev_features.h
new file mode 100644
index 0000000..a7394f4
--- /dev/null
+++ b/backport/backport-include/linux/netdev_features.h
@@ -0,0 +1,15 @@
+#ifndef __BACKPORT_NETDEV_FEATURES_H
+#define __BACKPORT_NETDEV_FEATURES_H
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+#include <linux/netdevice.h>
+#include <linux/types.h>
+
+typedef u32 netdev_features_t;
+#else
+#include_next <linux/netdev_features.h>
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) */
+
+#endif /* __BACKPORT_NETDEV_FEATURES_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index cf38903..441db72 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -1,6 +1,7 @@
 #ifndef __BACKPORT_NETDEVICE_H
 #define __BACKPORT_NETDEVICE_H
 #include_next <linux/netdevice.h>
+#include <linux/netdev_features.h>
 #include <linux/version.h>
 
 /* older kernels don't include this here, we need it */
@@ -19,4 +20,48 @@ extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_
 extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+/*
+ * BQL was added as of v3.3 but some Linux distributions
+ * have backported BQL to their v3.2 kernels or older. To
+ * address this we assume that they also enabled CONFIG_BQL
+ * and test for that here and simply avoid adding the static
+ * inlines if it was defined
+ */
+#ifndef CONFIG_BQL
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
+static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
+					unsigned int bytes)
+{
+}
+#endif
+
+static inline void netdev_sent_queue(struct net_device *dev, unsigned int bytes)
+{
+}
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
+static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
+					     unsigned pkts, unsigned bytes)
+{
+}
+#endif
+
+static inline void netdev_completed_queue(struct net_device *dev,
+					  unsigned pkts, unsigned bytes)
+{
+}
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
+static inline void netdev_tx_reset_queue(struct netdev_queue *q)
+{
+}
+#endif
+
+static inline void netdev_reset_queue(struct net_device *dev_queue)
+{
+}
+#endif /* CONFIG_BQL */
+#endif /* < 3.3 */
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/nl80211.h b/backport/backport-include/linux/nl80211.h
new file mode 100644
index 0000000..fcb0b8b
--- /dev/null
+++ b/backport/backport-include/linux/nl80211.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_LINUX_NL80211_H
+#define __BACKPORT_LINUX_NL80211_H
+#include_next <linux/nl80211.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+#define NL80211_FEATURE_SK_TX_STATUS 0
+#endif
+
+#endif /* __BACKPORT_LINUX_NL80211_H */
diff --git a/backport/backport-include/linux/pci_regs.h b/backport/backport-include/linux/pci_regs.h
index f479236..6d7f1e1 100644
--- a/backport/backport-include/linux/pci_regs.h
+++ b/backport/backport-include/linux/pci_regs.h
@@ -64,4 +64,22 @@
 #define  PCI_EXP_LNKCAP2_CROSSLINK 	0x100 /* Crosslink supported */
 #endif
 
+/*
+ * PCI_EXP_TYPE_RC_EC was added via 1b6b8ce2 on v2.6.30-rc4~20 :
+ *
+ * mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 1b6b8ce2
+ * v2.6.30-rc4~20^2
+ *
+ * but the fix for its definition was merged on v3.3-rc1~101^2~67
+ *
+ * mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 1830ea91
+ * v3.3-rc1~101^2~67
+ *
+ * while we can assume it got merged and backported on v3.2.28 (which it did
+ * see c1c3cd9) we cannot assume every kernel has it fixed so lets just undef
+ * it here and redefine it.
+ */
+#undef PCI_EXP_TYPE_RC_EC
+#define  PCI_EXP_TYPE_RC_EC    0xa     /* Root Complex Event Collector */
+
 #endif /* __BACKPORT_UAPI_PCI_REGS_H */
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 37c622c..e8ff5ac 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -15,4 +15,15 @@ extern void v2_6_28_skb_add_rx_frag(struct sk_buff *skb, int i,
 	skb_add_rx_frag(skb, i, page, off, size)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+#define __pskb_copy LINUX_BACKPORT(__pskb_copy)
+extern struct sk_buff *__pskb_copy(struct sk_buff *skb,
+				   int headroom, gfp_t gfp_mask);
+
+static inline void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
+{
+	WARN_ON(1);
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index e1ff8be..9485d37 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -4,6 +4,20 @@
 #include_next <linux/usb.h>
 #include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+/**
+ * module_usb_driver() - Helper macro for registering a USB driver
+ * @__usb_driver: usb_driver struct
+ *
+ * Helper macro for USB drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only
+ * use this macro once, and calling it replaces module_init() and module_exit()
+ */
+#define module_usb_driver(__usb_driver) \
+	module_driver(__usb_driver, usb_register, \
+		       usb_deregister)
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
 /**
  * Backports
diff --git a/backport/backport-include/net/sch_generic.h b/backport/backport-include/net/sch_generic.h
new file mode 100644
index 0000000..9c7207d
--- /dev/null
+++ b/backport/backport-include/net/sch_generic.h
@@ -0,0 +1,25 @@
+#ifndef __BACKPORT_NET_SCH_GENERIC_H
+#define __BACKPORT_NET_SCH_GENERIC_H
+#include_next <net/sch_generic.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+#if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,9) && LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,23) && LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)))
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37)
+/* mask qdisc_cb_private_validate as RHEL6 backports this */
+#define qdisc_cb_private_validate(a,b) compat_qdisc_cb_private_validate(a,b)
+static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
+{
+	BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct qdisc_skb_cb) + sz);
+}
+#else
+/* mask qdisc_cb_private_validate as RHEL6 backports this */
+#define qdisc_cb_private_validate(a,b) compat_qdisc_cb_private_validate(a,b)
+static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
+{
+	/* XXX ? */
+}
+#endif
+#endif
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) */
+
+#endif /* __BACKPORT_NET_SCH_GENERIC_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 18/42] backports: dissolve compat-3.2.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (16 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 17/42] backports: dissolve compat-3.3.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 19/42] backports: dissolve compat-3.1.h Johannes Berg
                   ` (26 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Also get rid of __netdev_printk() as it's no longer
exported from the kernel and thus can't be used by
any drivers/other backported code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-3.2.h      | 111 ----------------------
 backport/backport-include/linux/dma-mapping.h     |  17 ++++
 backport/backport-include/linux/dynamic_debug.h   |  25 +++++
 backport/backport-include/linux/if_ether.h        |   4 +
 backport/backport-include/linux/kernel.h          |  20 ++++
 backport/backport-include/linux/mmc/sdio.h        |  14 +++
 backport/backport-include/linux/platform_device.h |   6 ++
 backport/backport-include/linux/pm.h              |   4 +
 backport/backport-include/linux/skbuff.h          |  28 ++++++
 backport/compat/Makefile                          |   1 -
 backport/compat/compat-2.6.26.c                   |   3 +
 backport/compat/compat-3.2.c                      |  34 -------
 12 files changed, 121 insertions(+), 146 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-3.2.h
 create mode 100644 backport/backport-include/linux/dma-mapping.h
 create mode 100644 backport/backport-include/linux/dynamic_debug.h
 create mode 100644 backport/backport-include/linux/mmc/sdio.h
 delete mode 100644 backport/compat/compat-3.2.c

diff --git a/backport/backport-include/linux/compat-3.2.h b/backport/backport-include/linux/compat-3.2.h
deleted file mode 100644
index 982b989..0000000
--- a/backport/backport-include/linux/compat-3.2.h
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef LINUX_3_2_COMPAT_H
-#define LINUX_3_2_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0))
-
-#include <linux/skbuff.h>
-#include <linux/dma-mapping.h>
-#include <linux/printk.h>
-
-/* backports 07613b0b */
-#if defined(CONFIG_DYNAMIC_DEBUG)
-#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt)               \
-	static struct _ddebug __used __aligned(8)               \
-	__attribute__((section("__verbose"))) name = {          \
-		.modname = KBUILD_MODNAME,                      \
-		.function = __func__,                           \
-		.filename = __FILE__,                           \
-		.format = (fmt),                                \
-		.lineno = __LINE__,                             \
-		.flags =  _DPRINTK_FLAGS_DEFAULT,               \
-		.enabled = false,                               \
-	}
-#endif /* defined(CONFIG_DYNAMIC_DEBUG) */
-
-/* backports b4625dab */
-#define  SDIO_CCCR_REV_3_00    3       /* CCCR/FBR Version 3.00 */
-#define  SDIO_SDIO_REV_3_00    4       /* SDIO Spec Version 3.00 */
-
-#define PMSG_IS_AUTO(msg)	(((msg).event & PM_EVENT_AUTO) != 0)
-
-/* mask skb_frag_page as RHEL6 backports this */
-#define skb_frag_page(a) compat_skb_frag_page(a)
-
-/**
- * skb_frag_page - retrieve the page refered to by a paged fragment
- * @frag: the paged fragment
- *
- * Returns the &struct page associated with @frag.
- */
-static inline struct page *skb_frag_page(const skb_frag_t *frag)
-{
-	return frag->page;
-}
-
-/* mask skb_frag_dma_map as RHEL6 backports this */
-#define skb_frag_dma_map(a,b,c,d,e) compat_skb_frag_dma_map(a,b,c,d,e)
-
-/**
- * skb_frag_dma_map - maps a paged fragment via the DMA API
- * @device: the device to map the fragment to
- * @frag: the paged fragment to map
- * @offset: the offset within the fragment (starting at the
- *          fragment's own offset)
- * @size: the number of bytes to map
- * @direction: the direction of the mapping (%PCI_DMA_*)
- *
- * Maps the page associated with @frag to @device.
- */
-static inline dma_addr_t skb_frag_dma_map(struct device *dev,
-					  const skb_frag_t *frag,
-					  size_t offset, size_t size,
-					  enum dma_data_direction dir)
-{
-	return dma_map_page(dev, skb_frag_page(frag),
-			    frag->page_offset + offset, size, dir);
-}
-
-#define ETH_P_TDLS	0x890D          /* TDLS */
-
-/* mask skb_frag_size as RHEL6 backports this */
-#define skb_frag_size(a) compat_skb_frag_size(a)
-
-static inline unsigned int skb_frag_size(const skb_frag_t *frag)
-{
-	return frag->size;
-}
-
-static inline char *hex_byte_pack(char *buf, u8 byte)
-{
-	*buf++ = hex_asc_hi(byte);
-	*buf++ = hex_asc_lo(byte);
-	return buf;
-}
-
-/* module_platform_driver() - Helper macro for drivers that don't do
- * anything special in module init/exit.  This eliminates a lot of
- * boilerplate.  Each module may only use this macro once, and
- * calling it replaces module_init() and module_exit()
- */
-#define module_platform_driver(__platform_driver) \
-        module_driver(__platform_driver, platform_driver_register, \
-                        platform_driver_unregister)
-
-static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
-					dma_addr_t *dma_handle, gfp_t flag)
-{
-	void *ret = dma_alloc_coherent(dev, size, dma_handle, flag);
-	if (ret)
-		memset(ret, 0, size);
-	return ret;
-}
-
-#define __netdev_printk LINUX_BACKPORT(__netdev_printk)
-extern int __netdev_printk(const char *level, const struct net_device *dev,
-			   struct va_format *vaf);
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */
-
-#endif /* LINUX_3_2_COMPAT_H */
diff --git a/backport/backport-include/linux/dma-mapping.h b/backport/backport-include/linux/dma-mapping.h
new file mode 100644
index 0000000..091e505
--- /dev/null
+++ b/backport/backport-include/linux/dma-mapping.h
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_LINUX_DMA_MAPPING_H
+#define __BACKPORT_LINUX_DMA_MAPPING_H
+#include_next <linux/dma-mapping.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
+					dma_addr_t *dma_handle, gfp_t flag)
+{
+	void *ret = dma_alloc_coherent(dev, size, dma_handle, flag);
+	if (ret)
+		memset(ret, 0, size);
+	return ret;
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_DMA_MAPPING_H */
diff --git a/backport/backport-include/linux/dynamic_debug.h b/backport/backport-include/linux/dynamic_debug.h
new file mode 100644
index 0000000..00ab160
--- /dev/null
+++ b/backport/backport-include/linux/dynamic_debug.h
@@ -0,0 +1,25 @@
+#ifndef __BACKPORT_LINUX_DYNAMIC_DEBUG_H
+#define __BACKPORT_LINUX_DYNAMIC_DEBUG_H
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
+#include_next <linux/dynamic_debug.h>
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+/* backports 07613b0b */
+#if defined(CONFIG_DYNAMIC_DEBUG)
+#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt)               \
+	static struct _ddebug __used __aligned(8)               \
+	__attribute__((section("__verbose"))) name = {          \
+		.modname = KBUILD_MODNAME,                      \
+		.function = __func__,                           \
+		.filename = __FILE__,                           \
+		.format = (fmt),                                \
+		.lineno = __LINE__,                             \
+		.flags =  _DPRINTK_FLAGS_DEFAULT,               \
+		.enabled = false,                               \
+	}
+#endif /* defined(CONFIG_DYNAMIC_DEBUG) */
+#endif /* < 3.2 */
+
+#endif /* __BACKPORT_LINUX_DYNAMIC_DEBUG_H */
diff --git a/backport/backport-include/linux/if_ether.h b/backport/backport-include/linux/if_ether.h
index a3c6e45..e5f103e 100644
--- a/backport/backport-include/linux/if_ether.h
+++ b/backport/backport-include/linux/if_ether.h
@@ -14,4 +14,8 @@
 #define ETH_P_802_3_MIN 0x0600
 #endif
 
+#ifndef ETH_P_TDLS
+#define ETH_P_TDLS	0x890D          /* TDLS */
+#endif
+
 #endif /* __BACKPORT_IF_ETHER_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index 01aaa91..67dca62 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -26,4 +26,24 @@ extern int strict_strtol(const char *, unsigned int, long *);
 #define SIZE_MAX    (~(size_t)0)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+extern const char hex_asc[];
+#endif
+
+#ifndef hex_asc_hi
+#define hex_asc_hi(x)	hex_asc[((x) & 0xf0) >> 4]
+#endif
+#ifndef hex_asc_lo
+#define hex_asc_lo(x)	hex_asc[((x) & 0x0f)]
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+static inline char *hex_byte_pack(char *buf, u8 byte)
+{
+	*buf++ = hex_asc_hi(byte);
+	*buf++ = hex_asc_lo(byte);
+	return buf;
+}
+#endif
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/mmc/sdio.h b/backport/backport-include/linux/mmc/sdio.h
new file mode 100644
index 0000000..9bdbdc5
--- /dev/null
+++ b/backport/backport-include/linux/mmc/sdio.h
@@ -0,0 +1,14 @@
+#ifndef __BACKPORT_MMC_SDIO_H
+#define __BACKPORT_MMC_SDIO_H
+#include <linux/version.h>
+#include_next <linux/mmc/sdio.h>
+
+/* backports b4625dab */
+#ifndef SDIO_CCCR_REV_3_00
+#define  SDIO_CCCR_REV_3_00    3       /* CCCR/FBR Version 3.00 */
+#endif
+#ifndef SDIO_SDIO_REV_3_00
+#define  SDIO_SDIO_REV_3_00    4       /* SDIO Spec Version 3.00 */
+#endif
+
+#endif /* __BACKPORT_MMC_SDIO_H */
diff --git a/backport/backport-include/linux/platform_device.h b/backport/backport-include/linux/platform_device.h
index f0d6f89..d7a34a9 100644
--- a/backport/backport-include/linux/platform_device.h
+++ b/backport/backport-include/linux/platform_device.h
@@ -27,4 +27,10 @@ module_exit(__platform_driver##_exit);
 #define PLATFORM_DEVID_AUTO	(-1)
 #endif
 
+#ifndef module_platform_driver
+#define module_platform_driver(__platform_driver) \
+        module_driver(__platform_driver, platform_driver_register, \
+                        platform_driver_unregister)
+#endif
+
 #endif /* __BACKPORT_PLATFORM_DEVICE_H */
diff --git a/backport/backport-include/linux/pm.h b/backport/backport-include/linux/pm.h
index 5040949..09ab926 100644
--- a/backport/backport-include/linux/pm.h
+++ b/backport/backport-include/linux/pm.h
@@ -6,4 +6,8 @@
 #define PM_EVENT_SLEEP  (PM_EVENT_SUSPEND)
 #endif
 
+#ifndef PMSG_IS_AUTO
+#define PMSG_IS_AUTO(msg)	(((msg).event & PM_EVENT_AUTO) != 0)
+#endif
+
 #endif /* __BACKPORT_PM_H */
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index e8ff5ac..113d638 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -26,4 +26,32 @@ static inline void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+#include <linux/dma-mapping.h>
+
+/* mask skb_frag_page as RHEL6 backports this */
+#define skb_frag_page LINUX_BACKPORT(skb_frag_page)
+static inline struct page *skb_frag_page(const skb_frag_t *frag)
+{
+	return frag->page;
+}
+
+#define skb_frag_size LINUX_BACKPORT(skb_frag_size)
+static inline unsigned int skb_frag_size(const skb_frag_t *frag)
+{
+	return frag->size;
+}
+
+/* mask skb_frag_dma_map as RHEL6 backports this */
+#define skb_frag_dma_map LINUX_BACKPORT(skb_frag_dma_map)
+static inline dma_addr_t skb_frag_dma_map(struct device *dev,
+					  const skb_frag_t *frag,
+					  size_t offset, size_t size,
+					  enum dma_data_direction dir)
+{
+	return dma_map_page(dev, skb_frag_page(frag),
+			    frag->page_offset + offset, size, dir);
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 8c62cbb..59584f1 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -28,7 +28,6 @@ compat-$(CPTCFG_BACKPORT_BUILD_AVERAGE) += average.o
 compat-$(CPTCFG_BACKPORT_KERNEL_2_6_39) += compat-2.6.39.o kstrtox.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_0) += compat-3.0.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_1) += compat-3.1.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_2) += compat-3.2.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_3) += compat-3.3.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_4) += compat-3.4.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_5) += compat-3.5.o user_namespace.o
diff --git a/backport/compat/compat-2.6.26.c b/backport/compat/compat-2.6.26.c
index 5193886..9063a6a 100644
--- a/backport/compat/compat-2.6.26.c
+++ b/backport/compat/compat-2.6.26.c
@@ -17,6 +17,9 @@
 #include <net/sock.h>
 #include <net/compat.h>
 
+const char hex_asc[] = "0123456789abcdef";
+EXPORT_SYMBOL(hex_asc);
+
 /* 2.6.24 does not have the struct kobject with a name */
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
 
diff --git a/backport/compat/compat-3.2.c b/backport/compat/compat-3.2.c
deleted file mode 100644
index 55ae6af..0000000
--- a/backport/compat/compat-3.2.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012  Luis R. Rodriguez <mcgrof@frijolero.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 3.2.
- */
-
-#include <linux/kernel.h>
-#include <linux/device.h>
-
-int __netdev_printk(const char *level, const struct net_device *dev,
-			   struct va_format *vaf)
-{
-	int r;
-
-	if (dev && dev->dev.parent)
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35))
-		r = dev_printk(level, dev->dev.parent, "%s: %pV",
-			       netdev_name(dev), vaf);
-#else
-		/* XXX: this could likely be done better but I'm lazy */
-		r = printk("%s%s: %pV", level, netdev_name(dev), vaf);
-#endif
-	else if (dev)
-		r = printk("%s%s: %pV", level, netdev_name(dev), vaf);
-	else
-		r = printk("%s(NULL net_device): %pV", level, vaf);
-
-	return r;
-}
-EXPORT_SYMBOL_GPL(__netdev_printk);
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 19/42] backports: dissolve compat-3.1.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (17 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 18/42] backports: dissolve compat-3.2.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 20/42] backports: dissolve compat-3.0.h Johannes Berg
                   ` (25 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/asm/atomic.h       |  20 ++++++
 backport/backport-include/linux/compat-3.1.h | 100 ---------------------------
 backport/backport-include/linux/cpufreq.h    |  13 ++++
 backport/backport-include/linux/hid.h        |   4 ++
 backport/backport-include/linux/idr.h        |   9 +++
 backport/backport-include/linux/if.h         |   9 +++
 backport/backport-include/linux/kernel.h     |  13 ++++
 backport/backport-include/linux/security.h   |  18 +++++
 backport/backport-include/linux/skbuff.h     |  14 ++++
 backport/backport-include/linux/watchdog.h   |  10 +++
 backport/backport-include/net/genetlink.h    |   4 ++
 backport/backport-include/net/ip.h           |  14 ++++
 backport/backport-include/pcmcia/device_id.h |  16 +++++
 13 files changed, 144 insertions(+), 100 deletions(-)
 create mode 100644 backport/backport-include/asm/atomic.h
 delete mode 100644 backport/backport-include/linux/compat-3.1.h
 create mode 100644 backport/backport-include/linux/cpufreq.h
 create mode 100644 backport/backport-include/linux/if.h
 create mode 100644 backport/backport-include/linux/security.h
 create mode 100644 backport/backport-include/linux/watchdog.h
 create mode 100644 backport/backport-include/net/ip.h
 create mode 100644 backport/backport-include/pcmcia/device_id.h

diff --git a/backport/backport-include/asm/atomic.h b/backport/backport-include/asm/atomic.h
new file mode 100644
index 0000000..f8c9fa7
--- /dev/null
+++ b/backport/backport-include/asm/atomic.h
@@ -0,0 +1,20 @@
+#ifndef __BACKPORT_ASM_ATOMIC_H
+#define __BACKPORT_ASM_ATOMIC_H
+#include_next <asm/atomic.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+/*
+ * In many versions, several architectures do not seem to include an
+ * atomic64_t implementation, and do not include the software emulation from
+ * asm-generic/atomic64_t.
+ * Detect and handle this here.
+ */
+#include <asm/atomic.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)) && !defined(ATOMIC64_INIT) && !defined(CONFIG_X86) && !((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) && defined(CONFIG_ARM) && !defined(CONFIG_GENERIC_ATOMIC64))
+#include <asm-generic/atomic64.h>
+#endif
+#endif
+
+#endif /* __BACKPORT_ASM_ATOMIC_H */
diff --git a/backport/backport-include/linux/compat-3.1.h b/backport/backport-include/linux/compat-3.1.h
deleted file mode 100644
index d2ac0db..0000000
--- a/backport/backport-include/linux/compat-3.1.h
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef LINUX_3_1_COMPAT_H
-#define LINUX_3_1_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
-
-#include <linux/security.h>
-#include <linux/skbuff.h>
-#include <net/ip.h>
-#include <linux/idr.h>
-#include <asm/div64.h>
-
-#define HID_TYPE_USBNONE 2
-
-/* This backports:
- *
- * commit 36a26c69b4c70396ef569c3452690fba0c1dec08
- * Author: Nicholas Bellinger <nab@linux-iscsi.org>
- * Date:   Tue Jul 26 00:35:26 2011 -0700
- *
- * 	kernel.h: Add DIV_ROUND_UP_ULL and DIV_ROUND_UP_SECTOR_T macro usage
- */
-
-#define DIV_ROUND_UP_ULL(ll,d) \
-	({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
-
-/* Backports 56f8a75c */
-static inline bool ip_is_fragment(const struct iphdr *iph)
-{
-	return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
-}
-
-/* mask __netdev_alloc_skb_ip_align as RHEL6 backports this */
-#define __netdev_alloc_skb_ip_align(a,b,c) compat__netdev_alloc_skb_ip_align(a,b,c)
-static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
-							  unsigned int length, gfp_t gfp)
-{
-	struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
-
-	if (NET_IP_ALIGN && skb)
-		skb_reserve(skb, NET_IP_ALIGN);
-	return skb;
-}
-
-#define genl_dump_check_consistent(cb, user_hdr, family)
-
-#define IFF_TX_SKB_SHARING	0x10000	/* The interface supports sharing
-					 * skbs on transmit */
-
-#define PCMCIA_DEVICE_MANF_CARD_PROD_ID3(manf, card, v3, vh3) { \
-	.match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
-			PCMCIA_DEV_ID_MATCH_CARD_ID| \
-			PCMCIA_DEV_ID_MATCH_PROD_ID3, \
-	.manf_id = (manf), \
-	.card_id = (card), \
-	.prod_id = { NULL, NULL, (v3), NULL }, \
-	.prod_id_hash = { 0, 0, (vh3), 0 }, }
-
-/*
- * This has been defined in include/linux/security.h for some time, but was
- * only given an EXPORT_SYMBOL for 3.1.  Add a compat_* definition to avoid
- * breaking the compile.
- */
-#define security_sk_clone(a, b) compat_security_sk_clone(a, b)
-
-static inline void security_sk_clone(const struct sock *sk, struct sock *newsk)
-{
-}
-
-/*
- * In many versions, several architectures do not seem to include an
- * atomic64_t implementation, and do not include the software emulation from
- * asm-generic/atomic64_t.
- * Detect and handle this here.
- */
-#include <asm/atomic.h>
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)) && !defined(ATOMIC64_INIT) && !defined(CONFIG_X86) && !((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) && defined(CONFIG_ARM) && !defined(CONFIG_GENERIC_ATOMIC64))
-#include <asm-generic/atomic64.h>
-#endif
-
-#define ida_simple_get LINUX_BACKPORT(ida_simple_get)
-int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
-		   gfp_t gfp_mask);
-
-#define ida_simple_remove LINUX_BACKPORT(ida_simple_remove)
-void ida_simple_remove(struct ida *ida, unsigned int id);
-
-#ifdef CONFIG_CPU_FREQ
-#define cpufreq_quick_get_max LINUX_BACKPORT(cpufreq_quick_get_max)
-unsigned int cpufreq_quick_get_max(unsigned int cpu);
-#endif
-
-struct watchdog_device {
-};
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) */
-
-#endif /* LINUX_3_1_COMPAT_H */
diff --git a/backport/backport-include/linux/cpufreq.h b/backport/backport-include/linux/cpufreq.h
new file mode 100644
index 0000000..dbf234d
--- /dev/null
+++ b/backport/backport-include/linux/cpufreq.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_INCLUDE_CPUFREQ_H
+#define __BACKPORT_INCLUDE_CPUFREQ_H
+#include_next <linux/cpufreq.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+#ifdef CONFIG_CPU_FREQ
+#define cpufreq_quick_get_max LINUX_BACKPORT(cpufreq_quick_get_max)
+unsigned int cpufreq_quick_get_max(unsigned int cpu);
+#endif
+#endif
+
+#endif /* __BACKPORT_INCLUDE_CPUFREQ_H */
diff --git a/backport/backport-include/linux/hid.h b/backport/backport-include/linux/hid.h
index bb7455f..815eec4 100644
--- a/backport/backport-include/linux/hid.h
+++ b/backport/backport-include/linux/hid.h
@@ -8,4 +8,8 @@
 extern bool hid_ignore(struct hid_device *);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+#define HID_TYPE_USBNONE 2
+#endif
+
 #endif /* __BACKPORT_HID_H */
diff --git a/backport/backport-include/linux/idr.h b/backport/backport-include/linux/idr.h
index 0a0fc94..737632b 100644
--- a/backport/backport-include/linux/idr.h
+++ b/backport/backport-include/linux/idr.h
@@ -5,6 +5,15 @@
 #include_next <linux/idr.h>
 #include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+#define ida_simple_get LINUX_BACKPORT(ida_simple_get)
+int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
+		   gfp_t gfp_mask);
+
+#define ida_simple_remove LINUX_BACKPORT(ida_simple_remove)
+void ida_simple_remove(struct ida *ida, unsigned int id);
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
 #include <linux/errno.h>
 /**
diff --git a/backport/backport-include/linux/if.h b/backport/backport-include/linux/if.h
new file mode 100644
index 0000000..6a8c442
--- /dev/null
+++ b/backport/backport-include/linux/if.h
@@ -0,0 +1,9 @@
+#ifndef _BACKPORT_LINUX_IF_H
+#define _BACKPORT_LINUX_IF_H
+#include_next <linux/if.h>
+
+#ifndef  IFF_TX_SKB_SHARING
+#define IFF_TX_SKB_SHARING	0x10000
+#endif
+
+#endif	/* _BACKPORT_LINUX_IF_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index 67dca62..5dc8c61 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -46,4 +46,17 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
 }
 #endif
 
+/* This backports:
+ *
+ * commit 36a26c69b4c70396ef569c3452690fba0c1dec08
+ * Author: Nicholas Bellinger <nab@linux-iscsi.org>
+ * Date:   Tue Jul 26 00:35:26 2011 -0700
+ *
+ * 	kernel.h: Add DIV_ROUND_UP_ULL and DIV_ROUND_UP_SECTOR_T macro usage
+ */
+#ifndef DIV_ROUND_UP_ULL
+#define DIV_ROUND_UP_ULL(ll,d) \
+	({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
+#endif
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/security.h b/backport/backport-include/linux/security.h
new file mode 100644
index 0000000..af95e25
--- /dev/null
+++ b/backport/backport-include/linux/security.h
@@ -0,0 +1,18 @@
+#ifndef __BACKPORT_LINUX_SECURITY_H
+#define __BACKPORT_LINUX_SECURITY_H
+#include_next <linux/security.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+/*
+ * This has been defined in include/linux/security.h for some time, but was
+ * only given an EXPORT_SYMBOL for 3.1.  Add a compat_* definition to avoid
+ * breaking the compile.
+ */
+#define security_sk_clone(a, b) compat_security_sk_clone(a, b)
+
+static inline void security_sk_clone(const struct sock *sk, struct sock *newsk)
+{
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_SECURITY_H */
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 113d638..fcddd17 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -54,4 +54,18 @@ static inline dma_addr_t skb_frag_dma_map(struct device *dev,
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+/* mask __netdev_alloc_skb_ip_align as RHEL6 backports this */
+#define __netdev_alloc_skb_ip_align(a,b,c) compat__netdev_alloc_skb_ip_align(a,b,c)
+static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
+							  unsigned int length, gfp_t gfp)
+{
+	struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
+
+	if (NET_IP_ALIGN && skb)
+		skb_reserve(skb, NET_IP_ALIGN);
+	return skb;
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/watchdog.h b/backport/backport-include/linux/watchdog.h
new file mode 100644
index 0000000..4aae6bb
--- /dev/null
+++ b/backport/backport-include/linux/watchdog.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_WATCHDOG_H
+#define __BACKPORT_WATCHDOG_H
+#include_next <linux/watchdog.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+struct watchdog_device {
+};
+#endif
+
+#endif /* __BACKPORT_WATCHDOG_H */
diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index 44ffcaf..630ef89 100644
--- a/backport/backport-include/net/genetlink.h
+++ b/backport/backport-include/net/genetlink.h
@@ -13,4 +13,8 @@
 #define GENLMSG_DEFAULT_SIZE (NLMSG_DEFAULT_SIZE - GENL_HDRLEN)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+#define genl_dump_check_consistent(cb, user_hdr, family)
+#endif
+
 #endif /* __BACKPORT_NET_GENETLINK_H */
diff --git a/backport/backport-include/net/ip.h b/backport/backport-include/net/ip.h
new file mode 100644
index 0000000..909e603
--- /dev/null
+++ b/backport/backport-include/net/ip.h
@@ -0,0 +1,14 @@
+#ifndef __BACKPORT_NET_IP_H
+#define __BACKPORT_NET_IP_H
+#include_next <net/ip.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+/* Backports 56f8a75c */
+static inline bool ip_is_fragment(const struct iphdr *iph)
+{
+	return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
+}
+#endif
+
+#endif /* __BACKPORT_NET_IP_H */
diff --git a/backport/backport-include/pcmcia/device_id.h b/backport/backport-include/pcmcia/device_id.h
new file mode 100644
index 0000000..0c47a68
--- /dev/null
+++ b/backport/backport-include/pcmcia/device_id.h
@@ -0,0 +1,16 @@
+#ifndef __BACKPORT_PCMCIA_DEVICE_ID_H
+#define __BACKPORT_PCMCIA_DEVICE_ID_H
+#include_next <pcmcia/device_id.h>
+
+#ifndef PCMCIA_DEVICE_MANF_CARD_PROD_ID3
+#define PCMCIA_DEVICE_MANF_CARD_PROD_ID3(manf, card, v3, vh3) { \
+	.match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
+			PCMCIA_DEV_ID_MATCH_CARD_ID| \
+			PCMCIA_DEV_ID_MATCH_PROD_ID3, \
+	.manf_id = (manf), \
+	.card_id = (card), \
+	.prod_id = { NULL, NULL, (v3), NULL }, \
+	.prod_id_hash = { 0, 0, (vh3), 0 }, }
+#endif
+
+#endif /* __BACKPORT_PCMCIA_DEVICE_ID_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 20/42] backports: dissolve compat-3.0.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (18 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 19/42] backports: dissolve compat-3.1.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 21/42] backports: dissolve compat-2.6.39.h Johannes Berg
                   ` (24 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-3.0.h      | 163 ----------------------
 backport/backport-include/linux/if_ether.h        |   5 +
 backport/backport-include/linux/kernel.h          |  33 +++++
 backport/backport-include/linux/mod_devicetable.h |  22 +++
 backport/backport-include/linux/module.h          |  25 ++++
 backport/backport-include/linux/netdevice.h       |  23 +++
 backport/backport-include/linux/rcupdate.h        |  24 ++++
 backport/backport-include/linux/shmem_fs.h        |  37 +++++
 8 files changed, 169 insertions(+), 163 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-3.0.h
 create mode 100644 backport/backport-include/linux/rcupdate.h
 create mode 100644 backport/backport-include/linux/shmem_fs.h

diff --git a/backport/backport-include/linux/compat-3.0.h b/backport/backport-include/linux/compat-3.0.h
deleted file mode 100644
index 0bf179d..0000000
--- a/backport/backport-include/linux/compat-3.0.h
+++ /dev/null
@@ -1,163 +0,0 @@
-#ifndef LINUX_3_0_COMPAT_H
-#define LINUX_3_0_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0))
-
-#include <linux/rcupdate.h>
-
-/* This pulls-in a lot of non-exported symbol backports
- * on kernels older than 2.6.32. There's no harm for not
- * making this available on kernels < 2.6.32. */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
-#include <linux/pagemap.h>
-
-/* This backports the 2nd part of:
- *
- * commit d9d90e5eb70e09903dadff42099b6c948f814050
- * Author: Hugh Dickins <hughd@google.com>
- * Date:   Mon Jun 27 16:18:04 2011 -0700
- *
- *	tmpfs: add shmem_read_mapping_page_gfp
- *
- * First part is in compat-3.0.c.
- */
-#define shmem_read_mapping_page_gfp LINUX_BACKPORT(shmem_read_mapping_page_gfp)
-extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
-						pgoff_t index, gfp_t gfp);
-
-
-#define shmem_read_mapping_page LINUX_BACKPORT(shmem_read_mapping_page)
-static inline struct page *shmem_read_mapping_page(
-                               struct address_space *mapping, pgoff_t index)
-{
-       return shmem_read_mapping_page_gfp(mapping, index,
-                                       mapping_gfp_mask(mapping));
-}
-#endif
-
-
-/*
- * since commit 1c5cae815d19ffe02bdfda1260949ef2b1806171
- * "net: call dev_alloc_name from register_netdevice" dev_alloc_name is
- * called automatically. This is not implemented in older kernel
- * versions so it will result in device wrong names.
- */
-static inline int register_netdevice_name(struct net_device *dev)
-{
-	int err;
-
-	if (strchr(dev->name, '%')) {
-		err = dev_alloc_name(dev, dev->name);
-		if (err < 0)
-			return err;
-	}
-
-	return register_netdevice(dev);
-}
-
-#define register_netdevice(dev) register_netdevice_name(dev)
-
-/* BCMA core, see drivers/bcma/ */
-#ifndef BCMA_CORE
-/* Broadcom's specific AMBA core, see drivers/bcma/ */
-struct bcma_device_id {
-	__u16	manuf;
-	__u16	id;
-	__u8	rev;
-	__u8	class;
-};
-#define BCMA_CORE(_manuf, _id, _rev, _class)  \
-	{ .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, }
-#define BCMA_CORETABLE_END  \
-	{ 0, },
-
-#define BCMA_ANY_MANUF		0xFFFF
-#define BCMA_ANY_ID		0xFFFF
-#define BCMA_ANY_REV		0xFF
-#define BCMA_ANY_CLASS		0xFF
-#endif /* BCMA_CORE */
-
-#define mac_pton LINUX_BACKPORT(mac_pton)
-int mac_pton(const char *s, u8 *mac);
-
-int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res);
-int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res);
-int __must_check kstrtoul_from_user(const char __user *s, size_t count, unsigned int base, unsigned long *res);
-int __must_check kstrtol_from_user(const char __user *s, size_t count, unsigned int base, long *res);
-int __must_check kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, unsigned int *res);
-int __must_check kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, int *res);
-int __must_check kstrtou16_from_user(const char __user *s, size_t count, unsigned int base, u16 *res);
-int __must_check kstrtos16_from_user(const char __user *s, size_t count, unsigned int base, s16 *res);
-int __must_check kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *res);
-int __must_check kstrtos8_from_user(const char __user *s, size_t count, unsigned int base, s8 *res);
-
-static inline int __must_check kstrtou64_from_user(const char __user *s, size_t count, unsigned int base, u64 *res)
-{
-	return kstrtoull_from_user(s, count, base, res);
-}
-
-static inline int __must_check kstrtos64_from_user(const char __user *s, size_t count, unsigned int base, s64 *res)
-{
-	return kstrtoll_from_user(s, count, base, res);
-}
-
-static inline int __must_check kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, u32 *res)
-{
-	return kstrtouint_from_user(s, count, base, res);
-}
-
-static inline int __must_check kstrtos32_from_user(const char __user *s, size_t count, unsigned int base, s32 *res)
-{
-	return kstrtoint_from_user(s, count, base, res);
-}
-
-/* 
- * This adds a nested function everywhere kfree_rcu() was called. This
- * function frees the memory and is given as a function to call_rcu().
- * The rcu callback could happen every time also after the module was
- *  unloaded and this will cause problems.
- */
-#if !defined(kfree_rcu)
-#define kfree_rcu(data, rcuhead)		do {			\
-		void __kfree_rcu_fn(struct rcu_head *rcu_head)		\
-		{							\
-			void *___ptr;					\
-			___ptr = container_of(rcu_head, typeof(*(data)), rcuhead);\
-			kfree(___ptr);					\
-		}							\
-		call_rcu(&(data)->rcuhead, __kfree_rcu_fn);		\
-	} while (0)
-#endif
-#ifdef MODULE
-
-/*
- * The define overwriting module_exit is based on the original module_exit
- * which looks like this:
- * #define module_exit(exitfn)                                    \
- *         static inline exitcall_t __exittest(void)               \
- *         { return exitfn; }                                      \
- *         void cleanup_module(void) __attribute__((alias(#exitfn)));
- *
- * We replaced the call to the actual function exitfn() with a call to our
- * function which calls the original exitfn() and then rcu_barrier()
- *
- * As a module will not be unloaded that ofter it should not have a big
- * performance impact when rcu_barrier() is called on every module exit,
- * also when no kfree_rcu() backport is used in that module.
- */
-#undef module_exit
-#define module_exit(exitfn)						\
-	static void __exit __exit_compat(void)				\
-	{								\
-		exitfn();						\
-		rcu_barrier();						\
-	}								\
-	void cleanup_module(void) __attribute__((alias("__exit_compat")));
-
-#endif
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)) */
-
-#endif /* LINUX_3_0_COMPAT_H */
diff --git a/backport/backport-include/linux/if_ether.h b/backport/backport-include/linux/if_ether.h
index e5f103e..b47722c 100644
--- a/backport/backport-include/linux/if_ether.h
+++ b/backport/backport-include/linux/if_ether.h
@@ -18,4 +18,9 @@
 #define ETH_P_TDLS	0x890D          /* TDLS */
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+#define mac_pton LINUX_BACKPORT(mac_pton)
+int mac_pton(const char *s, u8 *mac);
+#endif
+
 #endif /* __BACKPORT_IF_ETHER_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index 5dc8c61..7d22b74 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -59,4 +59,37 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
 	({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res);
+int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res);
+int __must_check kstrtoul_from_user(const char __user *s, size_t count, unsigned int base, unsigned long *res);
+int __must_check kstrtol_from_user(const char __user *s, size_t count, unsigned int base, long *res);
+int __must_check kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, unsigned int *res);
+int __must_check kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, int *res);
+int __must_check kstrtou16_from_user(const char __user *s, size_t count, unsigned int base, u16 *res);
+int __must_check kstrtos16_from_user(const char __user *s, size_t count, unsigned int base, s16 *res);
+int __must_check kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *res);
+int __must_check kstrtos8_from_user(const char __user *s, size_t count, unsigned int base, s8 *res);
+
+static inline int __must_check kstrtou64_from_user(const char __user *s, size_t count, unsigned int base, u64 *res)
+{
+	return kstrtoull_from_user(s, count, base, res);
+}
+
+static inline int __must_check kstrtos64_from_user(const char __user *s, size_t count, unsigned int base, s64 *res)
+{
+	return kstrtoll_from_user(s, count, base, res);
+}
+
+static inline int __must_check kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, u32 *res)
+{
+	return kstrtouint_from_user(s, count, base, res);
+}
+
+static inline int __must_check kstrtos32_from_user(const char __user *s, size_t count, unsigned int base, s32 *res)
+{
+	return kstrtoint_from_user(s, count, base, res);
+}
+#endif
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/mod_devicetable.h b/backport/backport-include/linux/mod_devicetable.h
index 5ad4c06..59321af 100644
--- a/backport/backport-include/linux/mod_devicetable.h
+++ b/backport/backport-include/linux/mod_devicetable.h
@@ -10,4 +10,26 @@
 #define HID_GROUP_ANY                          0x0000
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+#ifndef BCMA_CORE
+/* Broadcom's specific AMBA core, see drivers/bcma/ */
+struct bcma_device_id {
+	__u16	manuf;
+	__u16	id;
+	__u8	rev;
+	__u8	class;
+};
+#define BCMA_CORE(_manuf, _id, _rev, _class)  \
+	{ .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, }
+#define BCMA_CORETABLE_END  \
+	{ 0, },
+
+#define BCMA_ANY_MANUF		0xFFFF
+#define BCMA_ANY_ID		0xFFFF
+#define BCMA_ANY_REV		0xFF
+#define BCMA_ANY_CLASS		0xFF
+#endif /* BCMA_CORE */
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)) */
+
 #endif /* __BACKPORT_MOD_DEVICETABLE_H */
diff --git a/backport/backport-include/linux/module.h b/backport/backport-include/linux/module.h
index 8112ebc..6bddc76 100644
--- a/backport/backport-include/linux/module.h
+++ b/backport/backport-include/linux/module.h
@@ -1,6 +1,7 @@
 #ifndef __BACKPORT_LINUX_MODULE_H
 #define __BACKPORT_LINUX_MODULE_H
 #include_next <linux/module.h>
+#include <linux/rcupdate.h>
 
 /*
  * The define overwriting module_init is based on the original module_init
@@ -34,4 +35,28 @@ extern void backport_dependency_symbol(void);
 	int init_module(void) __attribute__((alias("__init_backport")));\
 	BACKPORT_MOD_VERSIONS
 
+/*
+ * The define overwriting module_exit is based on the original module_exit
+ * which looks like this:
+ * #define module_exit(exitfn)                                    \
+ *         static inline exitcall_t __exittest(void)               \
+ *         { return exitfn; }                                      \
+ *         void cleanup_module(void) __attribute__((alias(#exitfn)));
+ *
+ * We replaced the call to the actual function exitfn() with a call to our
+ * function which calls the original exitfn() and then rcu_barrier()
+ *
+ * As a module will not be unloaded that ofter it should not have a big
+ * performance impact when rcu_barrier() is called on every module exit,
+ * also when no kfree_rcu() backport is used in that module.
+ */
+#undef module_exit
+#define module_exit(exitfn)						\
+	static void __exit __exit_compat(void)				\
+	{								\
+		exitfn();						\
+		rcu_barrier();						\
+	}								\
+	void cleanup_module(void) __attribute__((alias("__exit_compat")));
+
 #endif /* __BACKPORT_LINUX_MODULE_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 441db72..4b2a1ea 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -64,4 +64,27 @@ static inline void netdev_reset_queue(struct net_device *dev_queue)
 #endif /* CONFIG_BQL */
 #endif /* < 3.3 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+/*
+ * since commit 1c5cae815d19ffe02bdfda1260949ef2b1806171
+ * "net: call dev_alloc_name from register_netdevice" dev_alloc_name is
+ * called automatically. This is not implemented in older kernel
+ * versions so it will result in device wrong names.
+ */
+static inline int register_netdevice_name(struct net_device *dev)
+{
+	int err;
+
+	if (strchr(dev->name, '%')) {
+		err = dev_alloc_name(dev, dev->name);
+		if (err < 0)
+			return err;
+	}
+
+	return register_netdevice(dev);
+}
+
+#define register_netdevice(dev) register_netdevice_name(dev)
+#endif
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/rcupdate.h b/backport/backport-include/linux/rcupdate.h
new file mode 100644
index 0000000..9bfa939
--- /dev/null
+++ b/backport/backport-include/linux/rcupdate.h
@@ -0,0 +1,24 @@
+#ifndef __BACKPORT_LINUX_RCUPDATE_H
+#define __BACKPORT_LINUX_RCUPDATE_H
+#include_next <linux/rcupdate.h>
+
+/* 
+ * This adds a nested function everywhere kfree_rcu() was called. This
+ * function frees the memory and is given as a function to call_rcu().
+ * The rcu callback could happen every time also after the module was
+ * unloaded and this will cause problems. To address that problem, we
+ * put rcu_barrier() into each module_exit() in module.h.
+ */
+#if !defined(kfree_rcu)
+#define kfree_rcu(data, rcuhead)		do {			\
+		void __kfree_rcu_fn(struct rcu_head *rcu_head)		\
+		{							\
+			void *___ptr;					\
+			___ptr = container_of(rcu_head, typeof(*(data)), rcuhead);\
+			kfree(___ptr);					\
+		}							\
+		call_rcu(&(data)->rcuhead, __kfree_rcu_fn);		\
+	} while (0)
+#endif
+
+#endif /* __BACKPORT_LINUX_RCUPDATE_H */
diff --git a/backport/backport-include/linux/shmem_fs.h b/backport/backport-include/linux/shmem_fs.h
new file mode 100644
index 0000000..f32de7a
--- /dev/null
+++ b/backport/backport-include/linux/shmem_fs.h
@@ -0,0 +1,37 @@
+#ifndef __BACKPORT_LINUX_SHMEM_FS_H
+#define __BACKPORT_LINUX_SHMEM_FS_H
+#include_next <linux/shmem_fs.h>
+
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+/* This pulls-in a lot of non-exported symbol backports
+ * on kernels older than 2.6.32. There's no harm for not
+ * making this available on kernels < 2.6.32. */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
+#include <linux/pagemap.h>
+/* This backports the 2nd part of:
+ *
+ * commit d9d90e5eb70e09903dadff42099b6c948f814050
+ * Author: Hugh Dickins <hughd@google.com>
+ * Date:   Mon Jun 27 16:18:04 2011 -0700
+ *
+ *	tmpfs: add shmem_read_mapping_page_gfp
+ *
+ * First part is in compat-3.0.c.
+ */
+#define shmem_read_mapping_page_gfp LINUX_BACKPORT(shmem_read_mapping_page_gfp)
+extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
+						pgoff_t index, gfp_t gfp);
+
+
+#define shmem_read_mapping_page LINUX_BACKPORT(shmem_read_mapping_page)
+static inline struct page *shmem_read_mapping_page(
+                               struct address_space *mapping, pgoff_t index)
+{
+       return shmem_read_mapping_page_gfp(mapping, index,
+                                       mapping_gfp_mask(mapping));
+}
+#endif
+#endif
+
+#endif /* __BACKPORT_LINUX_SHMEM_FS_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 21/42] backports: dissolve compat-2.6.39.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (19 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 20/42] backports: dissolve compat-3.0.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 22/42] backports: dissolve compat-2.6.38.h Johannes Berg
                   ` (23 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-2.6.39.h   | 183 ----------------------
 backport/backport-include/linux/err.h             |  16 ++
 backport/backport-include/linux/interrupt.h       |  13 ++
 backport/backport-include/linux/irq.h             |  85 ++++++++++
 backport/backport-include/linux/kernel.h          |  70 +++++++++
 backport/backport-include/linux/netdev_features.h |   4 +
 backport/backport-include/linux/tty.h             |   6 +
 7 files changed, 194 insertions(+), 183 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.39.h
 create mode 100644 backport/backport-include/linux/err.h
 create mode 100644 backport/backport-include/linux/interrupt.h
 create mode 100644 backport/backport-include/linux/irq.h

diff --git a/backport/backport-include/linux/compat-2.6.39.h b/backport/backport-include/linux/compat-2.6.39.h
deleted file mode 100644
index 863afa4..0000000
--- a/backport/backport-include/linux/compat-2.6.39.h
+++ /dev/null
@@ -1,183 +0,0 @@
-#ifndef LINUX_26_39_COMPAT_H
-#define LINUX_26_39_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
-
-#include <linux/tty.h>
-#include <linux/irq.h>
-#include <linux/kernel.h>
-#include <linux/err.h>
-
-static inline int __must_check PTR_RET(const void *ptr)
-{
-	if (IS_ERR(ptr))
-		return PTR_ERR(ptr);
-	else
-		return 0;
-}
-
-#if !defined(NETIF_F_RXCSUM)
-#define NETIF_F_RXCSUM 0
-#endif
-
-#define tiocmget(tty) tiocmget(tty, NULL)
-#define tiocmset(tty, set, clear) tiocmset(tty, NULL, set, clear)
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
-#define tty_set_termios LINUX_BACKPORT(tty_set_termios)
-extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt);
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) */
-
-static inline int irq_set_irq_wake(unsigned int irq, unsigned int on)
-{
-	return set_irq_wake(irq, on);
-}
-static inline int irq_set_chip(unsigned int irq, struct irq_chip *chip)
-{
-	return set_irq_chip(irq, chip);
-}
-static inline int irq_set_handler_data(unsigned int irq, void *data)
-{
-	return set_irq_data(irq, data);
-}
-static inline int irq_set_chip_data(unsigned int irq, void *data)
-{
-	return set_irq_chip_data(irq, data);
-}
-static inline int irq_set_irq_type(unsigned int irq, unsigned int type)
-{
-	return set_irq_type(irq, type);
-}
-static inline int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry)
-{
-	return set_irq_msi(irq, entry);
-}
-static inline struct irq_chip *irq_get_chip(unsigned int irq)
-{
-	return get_irq_chip(irq);
-}
-static inline void *irq_get_chip_data(unsigned int irq)
-{
-	return get_irq_chip_data(irq);
-}
-static inline void *irq_get_handler_data(unsigned int irq)
-{
-	return get_irq_data(irq);
-}
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
-static inline void *irq_data_get_irq_handler_data(struct irq_data *d)
-{
-	return irq_data_get_irq_data(d);
-}
-#endif
-
-static inline struct msi_desc *irq_get_msi_desc(unsigned int irq)
-{
-	return get_irq_msi(irq);
-}
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
-static inline void irq_set_noprobe(unsigned int irq)
-{
-	set_irq_noprobe(irq);
-}
-static inline void irq_set_probe(unsigned int irq)
-{
-	set_irq_probe(irq);
-}
-#endif
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
-static inline struct irq_chip *irq_desc_get_chip(struct irq_desc *desc)
-{
-	return get_irq_desc_chip(desc);
-}
-static inline void *irq_desc_get_handler_data(struct irq_desc *desc)
-{
-	return get_irq_desc_data(desc);
-}
-
-static inline void *irq_desc_get_chip_data(struct irq_desc *desc)
-{
-	return get_irq_desc_chip_data(desc);
-}
-
-static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
-{
-	return get_irq_desc_msi(desc);
-}
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) */
-
-/* 
- * kstrto* was included in kernel 2.6.38.4 and causes conflicts with the
- * version included in compat-drivers. We use strict_strtol to check if
- * kstrto* is already available.
- */
-#ifndef strict_strtoull
-/* Internal, do not use. */
-int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
-int __must_check _kstrtol(const char *s, unsigned int base, long *res);
-
-int __must_check kstrtoull(const char *s, unsigned int base, unsigned long long *res);
-int __must_check kstrtoll(const char *s, unsigned int base, long long *res);
-static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
-{
-	/*
-	 * We want to shortcut function call, but
-	 * __builtin_types_compatible_p(unsigned long, unsigned long long) = 0.
-	 */
-	if (sizeof(unsigned long) == sizeof(unsigned long long) &&
-	    __alignof__(unsigned long) == __alignof__(unsigned long long))
-		return kstrtoull(s, base, (unsigned long long *)res);
-	else
-		return _kstrtoul(s, base, res);
-}
-
-static inline int __must_check kstrtol(const char *s, unsigned int base, long *res)
-{
-	/*
-	 * We want to shortcut function call, but
-	 * __builtin_types_compatible_p(long, long long) = 0.
-	 */
-	if (sizeof(long) == sizeof(long long) &&
-	    __alignof__(long) == __alignof__(long long))
-		return kstrtoll(s, base, (long long *)res);
-	else
-		return _kstrtol(s, base, res);
-}
-
-int __must_check kstrtouint(const char *s, unsigned int base, unsigned int *res);
-int __must_check kstrtoint(const char *s, unsigned int base, int *res);
-
-static inline int __must_check kstrtou64(const char *s, unsigned int base, u64 *res)
-{
-	return kstrtoull(s, base, res);
-}
-
-static inline int __must_check kstrtos64(const char *s, unsigned int base, s64 *res)
-{
-	return kstrtoll(s, base, res);
-}
-
-static inline int __must_check kstrtou32(const char *s, unsigned int base, u32 *res)
-{
-	return kstrtouint(s, base, res);
-}
-
-static inline int __must_check kstrtos32(const char *s, unsigned int base, s32 *res)
-{
-	return kstrtoint(s, base, res);
-}
-
-int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
-int __must_check kstrtos16(const char *s, unsigned int base, s16 *res);
-int __must_check kstrtou8(const char *s, unsigned int base, u8 *res);
-int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
-#endif /* ifndef strict_strtol */
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */
-
-#endif /* LINUX_26_39_COMPAT_H */
diff --git a/backport/backport-include/linux/err.h b/backport/backport-include/linux/err.h
new file mode 100644
index 0000000..cf63ea0
--- /dev/null
+++ b/backport/backport-include/linux/err.h
@@ -0,0 +1,16 @@
+#ifndef __BACKPORT_LINUX_ERR_H
+#define __BACKPORT_LINUX_ERR_H
+#include_next <linux/err.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
+static inline int __must_check PTR_RET(const void *ptr)
+{
+	if (IS_ERR(ptr))
+		return PTR_ERR(ptr);
+	else
+		return 0;
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_ERR_H */
diff --git a/backport/backport-include/linux/interrupt.h b/backport/backport-include/linux/interrupt.h
new file mode 100644
index 0000000..79937a6
--- /dev/null
+++ b/backport/backport-include/linux/interrupt.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_LINUX_INTERRUPT_H
+#define __BACKPORT_LINUX_INTERRUPT_H
+#include_next <linux/interrupt.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
+static inline int irq_set_irq_wake(unsigned int irq, unsigned int on)
+{
+	return set_irq_wake(irq, on);
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_INTERRUPT_H */
diff --git a/backport/backport-include/linux/irq.h b/backport/backport-include/linux/irq.h
new file mode 100644
index 0000000..357d688
--- /dev/null
+++ b/backport/backport-include/linux/irq.h
@@ -0,0 +1,85 @@
+#ifndef __BACKPORT_LINUX_IRQ_H
+#define __BACKPORT_LINUX_IRQ_H
+#include_next <linux/irq.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
+static inline int irq_set_chip(unsigned int irq, struct irq_chip *chip)
+{
+	return set_irq_chip(irq, chip);
+}
+static inline int irq_set_handler_data(unsigned int irq, void *data)
+{
+	return set_irq_data(irq, data);
+}
+static inline int irq_set_chip_data(unsigned int irq, void *data)
+{
+	return set_irq_chip_data(irq, data);
+}
+static inline int irq_set_irq_type(unsigned int irq, unsigned int type)
+{
+	return set_irq_type(irq, type);
+}
+static inline int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry)
+{
+	return set_irq_msi(irq, entry);
+}
+static inline struct irq_chip *irq_get_chip(unsigned int irq)
+{
+	return get_irq_chip(irq);
+}
+static inline void *irq_get_chip_data(unsigned int irq)
+{
+	return get_irq_chip_data(irq);
+}
+static inline void *irq_get_handler_data(unsigned int irq)
+{
+	return get_irq_data(irq);
+}
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+static inline void *irq_data_get_irq_handler_data(struct irq_data *d)
+{
+	return irq_data_get_irq_data(d);
+}
+#endif
+
+static inline struct msi_desc *irq_get_msi_desc(unsigned int irq)
+{
+	return get_irq_msi(irq);
+}
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
+static inline void irq_set_noprobe(unsigned int irq)
+{
+	set_irq_noprobe(irq);
+}
+static inline void irq_set_probe(unsigned int irq)
+{
+	set_irq_probe(irq);
+}
+#endif
+#endif
+
+/* This is really in irqdesc.h, but nothing includes that directly */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
+static inline struct irq_chip *irq_desc_get_chip(struct irq_desc *desc)
+{
+	return get_irq_desc_chip(desc);
+}
+static inline void *irq_desc_get_handler_data(struct irq_desc *desc)
+{
+	return get_irq_desc_data(desc);
+}
+static inline void *irq_desc_get_chip_data(struct irq_desc *desc)
+{
+	return get_irq_desc_chip_data(desc);
+}
+static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
+{
+	return get_irq_desc_msi(desc);
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_IRQ_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index 7d22b74..c41ea1b 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -92,4 +92,74 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
+/* 
+ * kstrto* was included in kernel 2.6.38.4 and causes conflicts with the
+ * version included in compat-drivers. We use strict_strtol to check if
+ * kstrto* is already available.
+ */
+#ifndef strict_strtoull
+/* Internal, do not use. */
+int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
+int __must_check _kstrtol(const char *s, unsigned int base, long *res);
+
+int __must_check kstrtoull(const char *s, unsigned int base, unsigned long long *res);
+int __must_check kstrtoll(const char *s, unsigned int base, long long *res);
+static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
+{
+	/*
+	 * We want to shortcut function call, but
+	 * __builtin_types_compatible_p(unsigned long, unsigned long long) = 0.
+	 */
+	if (sizeof(unsigned long) == sizeof(unsigned long long) &&
+	    __alignof__(unsigned long) == __alignof__(unsigned long long))
+		return kstrtoull(s, base, (unsigned long long *)res);
+	else
+		return _kstrtoul(s, base, res);
+}
+
+static inline int __must_check kstrtol(const char *s, unsigned int base, long *res)
+{
+	/*
+	 * We want to shortcut function call, but
+	 * __builtin_types_compatible_p(long, long long) = 0.
+	 */
+	if (sizeof(long) == sizeof(long long) &&
+	    __alignof__(long) == __alignof__(long long))
+		return kstrtoll(s, base, (long long *)res);
+	else
+		return _kstrtol(s, base, res);
+}
+
+int __must_check kstrtouint(const char *s, unsigned int base, unsigned int *res);
+int __must_check kstrtoint(const char *s, unsigned int base, int *res);
+
+static inline int __must_check kstrtou64(const char *s, unsigned int base, u64 *res)
+{
+	return kstrtoull(s, base, res);
+}
+
+static inline int __must_check kstrtos64(const char *s, unsigned int base, s64 *res)
+{
+	return kstrtoll(s, base, res);
+}
+
+static inline int __must_check kstrtou32(const char *s, unsigned int base, u32 *res)
+{
+	return kstrtouint(s, base, res);
+}
+
+static inline int __must_check kstrtos32(const char *s, unsigned int base, s32 *res)
+{
+	return kstrtoint(s, base, res);
+}
+
+int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
+int __must_check kstrtos16(const char *s, unsigned int base, s16 *res);
+int __must_check kstrtou8(const char *s, unsigned int base, u8 *res);
+int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
+#endif /* ifndef strict_strtol */
+
+#endif /* < 2.6.39 */
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/netdev_features.h b/backport/backport-include/linux/netdev_features.h
index a7394f4..bac3a3e 100644
--- a/backport/backport-include/linux/netdev_features.h
+++ b/backport/backport-include/linux/netdev_features.h
@@ -12,4 +12,8 @@ typedef u32 netdev_features_t;
 #include_next <linux/netdev_features.h>
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) */
 
+#if !defined(NETIF_F_RXCSUM)
+#define NETIF_F_RXCSUM 0
+#endif
+
 #endif /* __BACKPORT_NETDEV_FEATURES_H */
diff --git a/backport/backport-include/linux/tty.h b/backport/backport-include/linux/tty.h
index 0424dc7..ec73e06 100644
--- a/backport/backport-include/linux/tty.h
+++ b/backport/backport-include/linux/tty.h
@@ -2,6 +2,12 @@
 #define __BACKPORT_LINUX_TTY_H
 #include_next <linux/tty.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+#define tty_set_termios LINUX_BACKPORT(tty_set_termios)
+extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt);
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
 /* Backports tty_lock: Localise the lock */
 #define tty_lock(__tty) tty_lock()
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 22/42] backports: dissolve compat-2.6.38.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (20 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 21/42] backports: dissolve compat-2.6.39.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 23/42] backports: dissolve compat-2.6.37.h Johannes Berg
                   ` (22 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

While at it, fix the SDIO backport because the
max_hw_segs,max_phys_segs -> max_segs change
was really done in 2.6.37, not 2.6.38.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/bug.h           |  45 +++++++
 backport/backport-include/linux/compat-2.6.38.h | 165 ------------------------
 backport/backport-include/linux/etherdevice.h   |  17 +++
 backport/backport-include/linux/if_ether.h      |   4 +
 backport/backport-include/linux/lockdep.h       |  27 ++++
 backport/backport-include/linux/mmc/host.h      |  11 ++
 backport/backport-include/linux/netdevice.h     |   6 +
 backport/backport-include/linux/pci_regs.h      |  13 ++
 backport/backport-include/linux/printk.h        |  30 +++++
 backport/backport-include/linux/skbuff.h        |   7 +
 backport/backport-include/linux/workqueue.h     |   5 +
 backport/backport-include/net/sch_generic.h     |  32 +++++
 12 files changed, 197 insertions(+), 165 deletions(-)
 create mode 100644 backport/backport-include/linux/bug.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.38.h
 create mode 100644 backport/backport-include/linux/lockdep.h
 create mode 100644 backport/backport-include/linux/mmc/host.h

diff --git a/backport/backport-include/linux/bug.h b/backport/backport-include/linux/bug.h
new file mode 100644
index 0000000..22c91aa
--- /dev/null
+++ b/backport/backport-include/linux/bug.h
@@ -0,0 +1,45 @@
+#ifndef __BACKPORT_LINUX_BUG_H
+#define __BACKPORT_LINUX_BUG_H
+#include_next <linux/bug.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+/* is defined there for older kernels */
+#include <linux/kernel.h>
+/* Backport of:
+ *
+ * commit 7ef88ad561457c0346355dfd1f53e503ddfde719
+ * Author: Rusty Russell <rusty@rustcorp.com.au>
+ * Date:   Mon Jan 24 14:45:10 2011 -0600
+ *
+ *     BUILD_BUG_ON: make it handle more cases
+ */
+#undef BUILD_BUG_ON
+/**
+ * BUILD_BUG_ON - break compile if a condition is true.
+ * @condition: the condition which the compiler should know is false.
+ *
+ * If you have some code which relies on certain constants being equal, or
+ * other compile-time-evaluated condition, you should use BUILD_BUG_ON to
+ * detect if someone changes it.
+ *
+ * The implementation uses gcc's reluctance to create a negative array, but
+ * gcc (as of 4.4) only emits that error for obvious cases (eg. not arguments
+ * to inline functions).  So as a fallback we use the optimizer; if it can't
+ * prove the condition is false, it will cause a link error on the undefined
+ * "__build_bug_on_failed".  This error message can be harder to track down
+ * though, hence the two different methods.
+ */
+#ifndef __OPTIMIZE__
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+#else
+extern int __build_bug_on_failed;
+#define BUILD_BUG_ON(condition)					\
+	do {							\
+		((void)sizeof(char[1 - 2*!!(condition)]));	\
+		if (condition) __build_bug_on_failed = 1;	\
+	} while(0)
+#endif
+#endif /* < 2.6.38 */
+
+#endif /* __BACKPORT_LINUX_BUG_H */
diff --git a/backport/backport-include/linux/compat-2.6.38.h b/backport/backport-include/linux/compat-2.6.38.h
deleted file mode 100644
index 4a82310..0000000
--- a/backport/backport-include/linux/compat-2.6.38.h
+++ /dev/null
@@ -1,165 +0,0 @@
-#ifndef LINUX_26_38_COMPAT_H
-#define LINUX_26_38_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
-
-#include <linux/kernel.h>
-#include <linux/skbuff.h>
-#include <linux/etherdevice.h>
-#include <net/sch_generic.h>
-
-#define   PCI_MSIX_ENTRY_CTRL_MASKBIT  1
-
-#define alloc_etherdev_mqs(sizeof_priv, tx_q, rx_q) alloc_etherdev_mq(sizeof_priv, tx_q)
-
-/* MSI-X entry's format */
-#define PCI_MSIX_ENTRY_SIZE            16
-#define  PCI_MSIX_ENTRY_LOWER_ADDR     0
-#define  PCI_MSIX_ENTRY_UPPER_ADDR     4
-#define  PCI_MSIX_ENTRY_DATA           8
-#define  PCI_MSIX_ENTRY_VECTOR_CTRL    12
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
-static inline void bstats_update(struct gnet_stats_basic_packed *bstats,
-				 const struct sk_buff *skb)
-{
-	bstats->bytes += qdisc_pkt_len((struct sk_buff *) skb);
-	bstats->packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1;
-}
-static inline void qdisc_bstats_update(struct Qdisc *sch,
-				       const struct sk_buff *skb)
-{
-	bstats_update(&sch->bstats, skb);
-}
-#else
-/*
- * kernels <= 2.6.30 do not pass a const skb to qdisc_pkt_len, and
- * gnet_stats_basic_packed did not exist (see c1a8f1f1c8)
- */
-static inline void bstats_update(struct gnet_stats_basic *bstats,
-				 struct sk_buff *skb)
-{
-	bstats->bytes += qdisc_pkt_len(skb);
-	bstats->packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1;
-}
-static inline void qdisc_bstats_update(struct Qdisc *sch,
-				       struct sk_buff *skb)
-{
-	bstats_update(&sch->bstats, skb);
-}
-#endif
-
-
-/* rename member in struct mmc_host in include/linux/mmc/host.h */
-#define max_segs	max_hw_segs
-
-
-#define pr_warn pr_warning
-#define create_freezable_workqueue create_freezeable_workqueue
-
-static inline int skb_checksum_start_offset(const struct sk_buff *skb)
-{
-	return skb->csum_start - skb_headroom(skb);
-}
-
-/* from include/linux/printk.h */ 
-#define pr_emerg_once(fmt, ...)					\
-	printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_alert_once(fmt, ...)					\
-	printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_crit_once(fmt, ...)					\
-	printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_err_once(fmt, ...)					\
-	printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_warn_once(fmt, ...)					\
-	printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_notice_once(fmt, ...)				\
-	printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_info_once(fmt, ...)					\
-	printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_cont_once(fmt, ...)					\
-	printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
-#if defined(DEBUG)
-#define pr_debug_once(fmt, ...)					\
-	printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
-#else
-#define pr_debug_once(fmt, ...)					\
-	no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
-#endif
-
-/* include/linux/netdevice.h */
-#define alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs) \
-	alloc_netdev_mq(sizeof_priv, name, setup, \
-			max_t(unsigned int, txqs, rxqs))
-
-#define ETH_P_LINK_CTL	0x886c		/* HPNA, wlan link local tunnel */
-
-/**
- * is_unicast_ether_addr - Determine if the Ethernet address is unicast
- * @addr: Pointer to a six-byte array containing the Ethernet address
- *
- * Return true if the address is a unicast address.
- */
-static inline int is_unicast_ether_addr(const u8 *addr)
-{
-	return !is_multicast_ether_addr(addr);
-}
-
-/* Backport of:
- *
- * commit 7ef88ad561457c0346355dfd1f53e503ddfde719
- * Author: Rusty Russell <rusty@rustcorp.com.au>
- * Date:   Mon Jan 24 14:45:10 2011 -0600
- *
- *     BUILD_BUG_ON: make it handle more cases
- */
-#undef BUILD_BUG_ON
-/**
- * BUILD_BUG_ON - break compile if a condition is true.
- * @condition: the condition which the compiler should know is false.
- *
- * If you have some code which relies on certain constants being equal, or
- * other compile-time-evaluated condition, you should use BUILD_BUG_ON to
- * detect if someone changes it.
- *
- * The implementation uses gcc's reluctance to create a negative array, but
- * gcc (as of 4.4) only emits that error for obvious cases (eg. not arguments
- * to inline functions).  So as a fallback we use the optimizer; if it can't
- * prove the condition is false, it will cause a link error on the undefined
- * "__build_bug_on_failed".  This error message can be harder to track down
- * though, hence the two different methods.
- */
-#ifndef __OPTIMIZE__
-#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
-#else
-extern int __build_bug_on_failed;
-#define BUILD_BUG_ON(condition)					\
-	do {							\
-		((void)sizeof(char[1 - 2*!!(condition)]));	\
-		if (condition) __build_bug_on_failed = 1;	\
-	} while(0)
-#endif
-
-/* Backport of:
- *
- * commit e159489baa717dbae70f9903770a6a4990865887
- * Author: Tejun Heo <tj@kernel.org>
- * Date:   Sun Jan 9 23:32:15 2011 +0100
- *
- *     workqueue: relax lockdep annotation on flush_work()
- */
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-# ifdef CONFIG_PROVE_LOCKING
-#  define lock_map_acquire_read(l)	lock_acquire(l, 0, 0, 2, 2, NULL, _THIS_IP_)
-# else
-#  define lock_map_acquire_read(l)	lock_acquire(l, 0, 0, 2, 1, NULL, _THIS_IP_)
-# endif
-#else
-# define lock_map_acquire_read(l)		do { } while (0)
-#endif
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) */
-
-#endif /* LINUX_26_38_COMPAT_H */
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index bbabfbd..43dcba0 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -86,4 +86,21 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#define alloc_etherdev_mqs(sizeof_priv, tx_q, rx_q) alloc_etherdev_mq(sizeof_priv, tx_q)
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+/**
+ * is_unicast_ether_addr - Determine if the Ethernet address is unicast
+ * @addr: Pointer to a six-byte array containing the Ethernet address
+ *
+ * Return true if the address is a unicast address.
+ */
+static inline int is_unicast_ether_addr(const u8 *addr)
+{
+	return !is_multicast_ether_addr(addr);
+}
+#endif
+
 #endif /* _BACKPORT_LINUX_ETHERDEVICE_H */
diff --git a/backport/backport-include/linux/if_ether.h b/backport/backport-include/linux/if_ether.h
index b47722c..dd1bae4 100644
--- a/backport/backport-include/linux/if_ether.h
+++ b/backport/backport-include/linux/if_ether.h
@@ -18,6 +18,10 @@
 #define ETH_P_TDLS	0x890D          /* TDLS */
 #endif
 
+#ifndef ETH_P_LINK_CTL
+#define ETH_P_LINK_CTL	0x886c
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
 #define mac_pton LINUX_BACKPORT(mac_pton)
 int mac_pton(const char *s, u8 *mac);
diff --git a/backport/backport-include/linux/lockdep.h b/backport/backport-include/linux/lockdep.h
new file mode 100644
index 0000000..25706b9
--- /dev/null
+++ b/backport/backport-include/linux/lockdep.h
@@ -0,0 +1,27 @@
+#ifndef __BACKPORT_LINUX_LOCKDEP_H
+#define __BACKPORT_LINUX_LOCKDEP_H
+#include_next <linux/lockdep.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+/* Backport of:
+ *
+ * commit e159489baa717dbae70f9903770a6a4990865887
+ * Author: Tejun Heo <tj@kernel.org>
+ * Date:   Sun Jan 9 23:32:15 2011 +0100
+ *
+ *     workqueue: relax lockdep annotation on flush_work()
+ */
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# ifdef CONFIG_PROVE_LOCKING
+#  define lock_map_acquire_read(l)	lock_acquire(l, 0, 0, 2, 2, NULL, _THIS_IP_)
+# else
+#  define lock_map_acquire_read(l)	lock_acquire(l, 0, 0, 2, 1, NULL, _THIS_IP_)
+# endif
+#else
+# define lock_map_acquire_read(l)		do { } while (0)
+#endif
+
+#endif /* < 2.6.38 */
+
+#endif /* __BACKPORT_LINUX_LOCKDEP_H */
diff --git a/backport/backport-include/linux/mmc/host.h b/backport/backport-include/linux/mmc/host.h
new file mode 100644
index 0000000..49ca5c2
--- /dev/null
+++ b/backport/backport-include/linux/mmc/host.h
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_MMC_HOST_H
+#define __BACKPORT_MMC_HOST_H
+#include <linux/version.h>
+#include_next <linux/mmc/host.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+/* rename member in struct mmc_host */
+#define max_segs	max_hw_segs
+#endif
+
+#endif /* __BACKPORT_MMC_HOST_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 4b2a1ea..4f13782 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -87,4 +87,10 @@ static inline int register_netdevice_name(struct net_device *dev)
 #define register_netdevice(dev) register_netdevice_name(dev)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#define alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs) \
+	alloc_netdev_mq(sizeof_priv, name, setup, \
+			max_t(unsigned int, txqs, rxqs))
+#endif
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/pci_regs.h b/backport/backport-include/linux/pci_regs.h
index 6d7f1e1..d97e57f 100644
--- a/backport/backport-include/linux/pci_regs.h
+++ b/backport/backport-include/linux/pci_regs.h
@@ -82,4 +82,17 @@
 #undef PCI_EXP_TYPE_RC_EC
 #define  PCI_EXP_TYPE_RC_EC    0xa     /* Root Complex Event Collector */
 
+#ifndef PCI_MSIX_ENTRY_CTRL_MASKBIT
+#define PCI_MSIX_ENTRY_CTRL_MASKBIT  1
+#endif
+
+/* MSI-X entry's format */
+#ifndef PCI_MSIX_ENTRY_SIZE
+#define PCI_MSIX_ENTRY_SIZE            16
+#define  PCI_MSIX_ENTRY_LOWER_ADDR     0
+#define  PCI_MSIX_ENTRY_UPPER_ADDR     4
+#define  PCI_MSIX_ENTRY_DATA           8
+#define  PCI_MSIX_ENTRY_VECTOR_CTRL    12
+#endif
+
 #endif /* __BACKPORT_UAPI_PCI_REGS_H */
diff --git a/backport/backport-include/linux/printk.h b/backport/backport-include/linux/printk.h
index a255045..43429cf 100644
--- a/backport/backport-include/linux/printk.h
+++ b/backport/backport-include/linux/printk.h
@@ -35,4 +35,34 @@ do {                                                           \
 
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) */
 
+#ifndef pr_warn
+#define pr_warn pr_warning
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#define pr_emerg_once(fmt, ...)					\
+	printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_alert_once(fmt, ...)					\
+	printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_crit_once(fmt, ...)					\
+	printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_err_once(fmt, ...)					\
+	printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warn_once(fmt, ...)					\
+	printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_notice_once(fmt, ...)				\
+	printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_info_once(fmt, ...)					\
+	printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_cont_once(fmt, ...)					\
+	printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
+#if defined(DEBUG)
+#define pr_debug_once(fmt, ...)					\
+	printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#else
+#define pr_debug_once(fmt, ...)					\
+	no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#endif
+#endif
+
 #endif	/* _COMPAT_LINUX_PRINTK_H */
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index fcddd17..2ad3612 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -68,4 +68,11 @@ static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+static inline int skb_checksum_start_offset(const struct sk_buff *skb)
+{
+	return skb->csum_start - skb_headroom(skb);
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/workqueue.h b/backport/backport-include/linux/workqueue.h
index 6e9796f..f908afb 100644
--- a/backport/backport-include/linux/workqueue.h
+++ b/backport/backport-include/linux/workqueue.h
@@ -9,4 +9,9 @@ bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
 		      unsigned long delay);
 #endif
 
+#ifndef create_freezable_workqueue
+/* note freez_a_ble -> freez_ea_able */
+#define create_freezable_workqueue create_freezeable_workqueue
+#endif
+
 #endif /* __BACKPORT_LINUX_WORKQUEUE_H */
diff --git a/backport/backport-include/net/sch_generic.h b/backport/backport-include/net/sch_generic.h
index 9c7207d..0e4a2be 100644
--- a/backport/backport-include/net/sch_generic.h
+++ b/backport/backport-include/net/sch_generic.h
@@ -22,4 +22,36 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
 #endif
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)
+static inline void bstats_update(struct gnet_stats_basic_packed *bstats,
+				 const struct sk_buff *skb)
+{
+	bstats->bytes += qdisc_pkt_len((struct sk_buff *) skb);
+	bstats->packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1;
+}
+static inline void qdisc_bstats_update(struct Qdisc *sch,
+				       const struct sk_buff *skb)
+{
+	bstats_update(&sch->bstats, skb);
+}
+#else
+/*
+ * kernels <= 2.6.30 do not pass a const skb to qdisc_pkt_len, and
+ * gnet_stats_basic_packed did not exist (see c1a8f1f1c8)
+ */
+static inline void bstats_update(struct gnet_stats_basic *bstats,
+				 struct sk_buff *skb)
+{
+	bstats->bytes += qdisc_pkt_len(skb);
+	bstats->packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1;
+}
+static inline void qdisc_bstats_update(struct Qdisc *sch,
+				       struct sk_buff *skb)
+{
+	bstats_update(&sch->bstats, skb);
+}
+#endif
+#endif /* < 2.6.38 */
+
 #endif /* __BACKPORT_NET_SCH_GENERIC_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 23/42] backports: dissolve compat-2.6.37.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (21 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 22/42] backports: dissolve compat-2.6.38.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 24/42] backports: dissolve compat-2.6.36.h Johannes Berg
                   ` (21 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-2.6.37.h | 182 ------------------------
 backport/backport-include/linux/in.h            |  19 +++
 backport/backport-include/linux/kernel.h        |   5 +
 backport/backport-include/linux/leds.h          |  13 ++
 backport/backport-include/linux/mmc/sdio_ids.h  |  10 ++
 backport/backport-include/linux/netdevice.h     |  18 +++
 backport/backport-include/linux/rculist.h       |  15 ++
 backport/backport-include/linux/rcupdate.h      |   5 +
 backport/backport-include/linux/rtnetlink.h     |  10 ++
 backport/backport-include/linux/skbuff.h        |  16 +++
 backport/backport-include/linux/vmalloc.h       |  11 ++
 backport/backport-include/linux/workqueue.h     |   4 +
 backport/backport-include/net/genetlink.h       |  65 +++++++++
 backport/backport-include/pcmcia/ds.h           |   4 +
 14 files changed, 195 insertions(+), 182 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.37.h
 create mode 100644 backport/backport-include/linux/mmc/sdio_ids.h
 create mode 100644 backport/backport-include/linux/rtnetlink.h
 create mode 100644 backport/backport-include/linux/vmalloc.h

diff --git a/backport/backport-include/linux/compat-2.6.37.h b/backport/backport-include/linux/compat-2.6.37.h
deleted file mode 100644
index 317ae6f..0000000
--- a/backport/backport-include/linux/compat-2.6.37.h
+++ /dev/null
@@ -1,182 +0,0 @@
-#ifndef LINUX_26_37_COMPAT_H
-#define LINUX_26_37_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37))
-
-#include <linux/skbuff.h>
-#include <linux/leds.h>
-#include <linux/in.h>
-#include <linux/errno.h>
-#include <linux/netdevice.h>
-
-#ifdef CONFIG_RPS
-extern int netif_set_real_num_rx_queues(struct net_device *dev,
-					unsigned int rxq);
-#else
-static inline int netif_set_real_num_rx_queues(struct net_device *dev,
-					       unsigned int rxq)
-{
-	return 0;
-}
-#endif
-
-static inline int proto_ports_offset(int proto)
-{
-	switch (proto) {
-	case IPPROTO_TCP:
-	case IPPROTO_UDP:
-	case IPPROTO_DCCP:
-	case IPPROTO_ESP:	/* SPI */
-	case IPPROTO_SCTP:
-	case IPPROTO_UDPLITE:
-		return 0;
-	case IPPROTO_AH:	/* SPI */
-		return 4;
-	default:
-		return -EINVAL;
-	}
-}
-
-#define SDIO_CLASS_BT_AMP	0x09	/* Type-A Bluetooth AMP interface */
-
-#define net_ns_type_operations LINUX_BACKPORT(net_ns_type_operations)
-extern struct kobj_ns_type_operations net_ns_type_operations;
-
-/* mask skb_checksum_none_assert as RHEL6 backports this */
-#define skb_checksum_none_assert(a) compat_skb_checksum_none_assert(a)
-
-/**
- * skb_checksum_none_assert - make sure skb ip_summed is CHECKSUM_NONE
- * @skb: skb to check
- *
- * fresh skbs have their ip_summed set to CHECKSUM_NONE.
- * Instead of forcing ip_summed to CHECKSUM_NONE, we can
- * use this helper, to document places where we make this assertion.
- */
-static inline void skb_checksum_none_assert(struct sk_buff *skb)
-{
-#ifdef DEBUG
-	BUG_ON(skb->ip_summed != CHECKSUM_NONE);
-#endif
-}
-
-#define pcmcia_enable_device(link)	pcmcia_request_configuration(link, &link->conf)
-
-#include <net/genetlink.h>
-
-struct compat_genl_info {
-	struct genl_info *info;
-
-	u32 snd_seq;
-	u32 snd_pid;
-	struct genlmsghdr *genlhdr;
-	struct nlattr **attrs;
-	void *user_ptr[2];
-};
-#define genl_info compat_genl_info
-
-struct compat_genl_ops {
-	struct genl_ops ops;
-
-	u8 cmd;
-	u8 internal_flags;
-	unsigned int flags;
-	const struct nla_policy *policy;
-
-	int (*doit)(struct sk_buff *skb, struct genl_info *info);
-	int (*dumpit)(struct sk_buff *skb, struct netlink_callback *cb);
-	int (*done)(struct netlink_callback *cb);
-};
-#define genl_ops compat_genl_ops
-
-struct compat_genl_family {
-	struct genl_family family;
-
-	struct list_head list;
-
-	unsigned int id, hdrsize, version, maxattr;
-	const char *name;
-	bool netnsok;
-
-	struct nlattr **attrbuf;
-
-	int (*pre_doit)(struct genl_ops *ops, struct sk_buff *skb,
-			struct genl_info *info);
-
-	void (*post_doit)(struct genl_ops *ops, struct sk_buff *skb,
-			  struct genl_info *info);
-};
-
-#define genl_family compat_genl_family
-
-#define genl_register_family_with_ops compat_genl_register_family_with_ops
-
-int genl_register_family_with_ops(struct genl_family *family,
-				  struct genl_ops *ops, size_t n_ops);
-
-#define genl_unregister_family compat_genl_unregister_family
-
-int genl_unregister_family(struct genl_family *family);
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
-#define genl_info_net(_info) genl_info_net((_info)->info)
-#endif
-
-#define genlmsg_reply(_msg, _info) genlmsg_reply(_msg, (_info)->info)
-#define genlmsg_put(_skb, _pid, _seq, _fam, _flags, _cmd) genlmsg_put(_skb, _pid, _seq, &(_fam)->family, _flags, _cmd)
-#define genl_register_mc_group(_fam, _grp) genl_register_mc_group(&(_fam)->family, _grp)
-#define genl_unregister_mc_group(_fam, _grp) genl_unregister_mc_group(&(_fam)->family, _grp)
-
-
-extern void led_blink_set(struct led_classdev *led_cdev,
-			  unsigned long *delay_on,
-			  unsigned long *delay_off);
-
-#define led_classdev_unregister compat_led_classdev_unregister
-extern void compat_led_classdev_unregister(struct led_classdev *led_cdev);
-
-#define led_brightness_set compat_led_brightness_set
-extern void compat_led_brightness_set(struct led_classdev *led_cdev,
-				      enum led_brightness brightness);
-
-#define alloc_ordered_workqueue(name, flags) create_singlethread_workqueue(name)
-
-#define netdev_refcnt_read(a) atomic_read(&a->refcnt)
-
-#define vzalloc LINUX_BACKPORT(vzalloc)
-extern void *vzalloc(unsigned long size);
-
-#define rtnl_dereference(p)                                     \
-        rcu_dereference_protected(p, lockdep_rtnl_is_held())
-
-/**
- * RCU_INIT_POINTER() - initialize an RCU protected pointer
- *
- * Initialize an RCU-protected pointer in such a way to avoid RCU-lockdep
- * splats.
- */
-#define RCU_INIT_POINTER(p, v) \
-		p = (typeof(*v) __force __rcu *)(v)
-
-static inline bool skb_has_frag_list(const struct sk_buff *skb)
-{
-	return skb_shinfo(skb)->frag_list != NULL;
-}
-
-/**
- * backport:
- *
- * commit 67bdbffd696f29a0b68aa8daa285783a06651583
- * Author: Arnd Bergmann <arnd@arndb.de>
- * Date:   Thu Feb 25 16:55:13 2010 +0100
- *
- *     rculist: avoid __rcu annotations
- */
-#define hlist_first_rcu(head)	(*((struct hlist_node __rcu **)(&(head)->first)))
-#define hlist_next_rcu(node)	(*((struct hlist_node __rcu **)(&(node)->next)))
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) */
-
-#endif /* LINUX_26_37_COMPAT_H */
diff --git a/backport/backport-include/linux/in.h b/backport/backport-include/linux/in.h
index 5cca155..f019e0a 100644
--- a/backport/backport-include/linux/in.h
+++ b/backport/backport-include/linux/in.h
@@ -72,4 +72,23 @@ static inline bool ipv4_is_test_198(__be32 addr)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+static inline int proto_ports_offset(int proto)
+{
+	switch (proto) {
+	case IPPROTO_TCP:
+	case IPPROTO_UDP:
+	case IPPROTO_DCCP:
+	case IPPROTO_ESP:	/* SPI */
+	case IPPROTO_SCTP:
+	case IPPROTO_UDPLITE:
+		return 0;
+	case IPPROTO_AH:	/* SPI */
+		return 4;
+	default:
+		return -EINVAL;
+	}
+}
+#endif
+
 #endif /* __BACKPORT_IN_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index c41ea1b..5fdcdc0 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -2,6 +2,11 @@
 #define __BACKPORT_KERNEL_H
 #include_next <linux/kernel.h>
 #include <linux/version.h>
+/*
+ * some older kernels don't have this and thus don't
+ * include it from kernel.h like new kernels
+ */
+#include <linux/printk.h>
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
 /**
diff --git a/backport/backport-include/linux/leds.h b/backport/backport-include/linux/leds.h
index 17fc89e..a758c8e 100644
--- a/backport/backport-include/linux/leds.h
+++ b/backport/backport-include/linux/leds.h
@@ -26,4 +26,17 @@
 #define led_set_brightness(_dev, _switch) led_brightness_set(_dev, _switch)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+extern void led_blink_set(struct led_classdev *led_cdev,
+			  unsigned long *delay_on,
+			  unsigned long *delay_off);
+
+#define led_classdev_unregister compat_led_classdev_unregister
+extern void compat_led_classdev_unregister(struct led_classdev *led_cdev);
+
+#define led_brightness_set compat_led_brightness_set
+extern void compat_led_brightness_set(struct led_classdev *led_cdev,
+				      enum led_brightness brightness);
+#endif
+
 #endif /* __BACKPORT_LINUX_LEDS_H */
diff --git a/backport/backport-include/linux/mmc/sdio_ids.h b/backport/backport-include/linux/mmc/sdio_ids.h
new file mode 100644
index 0000000..3223fca
--- /dev/null
+++ b/backport/backport-include/linux/mmc/sdio_ids.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_MMC_SDIO_IDS_H
+#define __BACKPORT_MMC_SDIO_IDS_H
+#include <linux/version.h>
+#include_next <linux/mmc/sdio_ids.h>
+
+#ifndef SDIO_CLASS_BT_AMP
+#define SDIO_CLASS_BT_AMP	0x09	/* Type-A Bluetooth AMP interface */
+#endif
+
+#endif /* __BACKPORT_MMC_SDIO_IDS_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 4f13782..72cd504 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -93,4 +93,22 @@ static inline int register_netdevice_name(struct net_device *dev)
 			max_t(unsigned int, txqs, rxqs))
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+#define netdev_refcnt_read(a) atomic_read(&a->refcnt)
+
+#define net_ns_type_operations LINUX_BACKPORT(net_ns_type_operations)
+extern struct kobj_ns_type_operations net_ns_type_operations;
+
+#ifdef CONFIG_RPS
+extern int netif_set_real_num_rx_queues(struct net_device *dev,
+					unsigned int rxq);
+#else
+static inline int netif_set_real_num_rx_queues(struct net_device *dev,
+					       unsigned int rxq)
+{
+	return 0;
+}
+#endif
+#endif /* < 2.6.37 */
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/rculist.h b/backport/backport-include/linux/rculist.h
index 0f5eaf1..38afa4b 100644
--- a/backport/backport-include/linux/rculist.h
+++ b/backport/backport-include/linux/rculist.h
@@ -24,4 +24,19 @@
 	macro_dispatcher(hlist_for_each_entry_rcu, __VA_ARGS__)(__VA_ARGS__)
 #endif /* < 3.9 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+/**
+ * backport:
+ *
+ * commit 67bdbffd696f29a0b68aa8daa285783a06651583
+ * Author: Arnd Bergmann <arnd@arndb.de>
+ * Date:   Thu Feb 25 16:55:13 2010 +0100
+ *
+ *     rculist: avoid __rcu annotations
+ */
+#define hlist_first_rcu(head)	(*((struct hlist_node __rcu **)(&(head)->first)))
+#define hlist_next_rcu(node)	(*((struct hlist_node __rcu **)(&(node)->next)))
+
+#endif /* < 2.6.37 */
+
 #endif /* __BACKPORT_RCULIST_H */
diff --git a/backport/backport-include/linux/rcupdate.h b/backport/backport-include/linux/rcupdate.h
index 9bfa939..5770b11 100644
--- a/backport/backport-include/linux/rcupdate.h
+++ b/backport/backport-include/linux/rcupdate.h
@@ -21,4 +21,9 @@
 	} while (0)
 #endif
 
+#ifndef RCU_INIT_POINTER
+#define RCU_INIT_POINTER(p, v) \
+		p = (typeof(*v) __force __rcu *)(v)
+#endif
+
 #endif /* __BACKPORT_LINUX_RCUPDATE_H */
diff --git a/backport/backport-include/linux/rtnetlink.h b/backport/backport-include/linux/rtnetlink.h
new file mode 100644
index 0000000..b765cc8
--- /dev/null
+++ b/backport/backport-include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_LINUX_RTNETLINK_H
+#define __BACKPORT_LINUX_RTNETLINK_H
+#include_next <linux/rtnetlink.h>
+
+#ifndef rtnl_dereference
+#define rtnl_dereference(p)                                     \
+        rcu_dereference_protected(p, lockdep_rtnl_is_held())
+#endif
+
+#endif /* __BACKPORT_LINUX_RTNETLINK_H */
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 2ad3612..52f1345 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -75,4 +75,20 @@ static inline int skb_checksum_start_offset(const struct sk_buff *skb)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+static inline bool skb_has_frag_list(const struct sk_buff *skb)
+{
+	return skb_shinfo(skb)->frag_list != NULL;
+}
+
+#define skb_checksum_none_assert LINUX_BACKPORT(skb_checksum_none_assert)
+
+static inline void skb_checksum_none_assert(struct sk_buff *skb)
+{
+#ifdef DEBUG
+	BUG_ON(skb->ip_summed != CHECKSUM_NONE);
+#endif
+}
+#endif /* < 2.6.37 */
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/vmalloc.h b/backport/backport-include/linux/vmalloc.h
new file mode 100644
index 0000000..c47536f
--- /dev/null
+++ b/backport/backport-include/linux/vmalloc.h
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_LINUX_VMALLOC_H
+#define __BACKPORT_LINUX_VMALLOC_H
+#include_next <linux/vmalloc.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+#define vzalloc LINUX_BACKPORT(vzalloc)
+extern void *vzalloc(unsigned long size);
+#endif
+
+#endif /* __BACKPORT_LINUX_VMALLOC_H */
diff --git a/backport/backport-include/linux/workqueue.h b/backport/backport-include/linux/workqueue.h
index f908afb..cc50966 100644
--- a/backport/backport-include/linux/workqueue.h
+++ b/backport/backport-include/linux/workqueue.h
@@ -14,4 +14,8 @@ bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
 #define create_freezable_workqueue create_freezeable_workqueue
 #endif
 
+#ifndef alloc_ordered_workqueue
+#define alloc_ordered_workqueue(name, flags) create_singlethread_workqueue(name)
+#endif
+
 #endif /* __BACKPORT_LINUX_WORKQUEUE_H */
diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index 630ef89..0e10936 100644
--- a/backport/backport-include/net/genetlink.h
+++ b/backport/backport-include/net/genetlink.h
@@ -17,4 +17,69 @@
 #define genl_dump_check_consistent(cb, user_hdr, family)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+struct compat_genl_info {
+	struct genl_info *info;
+
+	u32 snd_seq;
+	u32 snd_pid;
+	struct genlmsghdr *genlhdr;
+	struct nlattr **attrs;
+	void *user_ptr[2];
+};
+#define genl_info compat_genl_info
+
+struct compat_genl_ops {
+	struct genl_ops ops;
+
+	u8 cmd;
+	u8 internal_flags;
+	unsigned int flags;
+	const struct nla_policy *policy;
+
+	int (*doit)(struct sk_buff *skb, struct genl_info *info);
+	int (*dumpit)(struct sk_buff *skb, struct netlink_callback *cb);
+	int (*done)(struct netlink_callback *cb);
+};
+#define genl_ops compat_genl_ops
+
+struct compat_genl_family {
+	struct genl_family family;
+
+	struct list_head list;
+
+	unsigned int id, hdrsize, version, maxattr;
+	const char *name;
+	bool netnsok;
+
+	struct nlattr **attrbuf;
+
+	int (*pre_doit)(struct genl_ops *ops, struct sk_buff *skb,
+			struct genl_info *info);
+
+	void (*post_doit)(struct genl_ops *ops, struct sk_buff *skb,
+			  struct genl_info *info);
+};
+
+#define genl_family compat_genl_family
+
+#define genl_register_family_with_ops compat_genl_register_family_with_ops
+
+int genl_register_family_with_ops(struct genl_family *family,
+				  struct genl_ops *ops, size_t n_ops);
+
+#define genl_unregister_family compat_genl_unregister_family
+
+int genl_unregister_family(struct genl_family *family);
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
+#define genl_info_net(_info) genl_info_net((_info)->info)
+#endif
+
+#define genlmsg_reply(_msg, _info) genlmsg_reply(_msg, (_info)->info)
+#define genlmsg_put(_skb, _pid, _seq, _fam, _flags, _cmd) genlmsg_put(_skb, _pid, _seq, &(_fam)->family, _flags, _cmd)
+#define genl_register_mc_group(_fam, _grp) genl_register_mc_group(&(_fam)->family, _grp)
+#define genl_unregister_mc_group(_fam, _grp) genl_unregister_mc_group(&(_fam)->family, _grp)
+#endif /* < 2.6.37 */
+
 #endif /* __BACKPORT_NET_GENETLINK_H */
diff --git a/backport/backport-include/pcmcia/ds.h b/backport/backport-include/pcmcia/ds.h
index 45ab33a..02f851f 100644
--- a/backport/backport-include/pcmcia/ds.h
+++ b/backport/backport-include/pcmcia/ds.h
@@ -26,4 +26,8 @@
 			pcmcia_unregister_driver)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+#define pcmcia_enable_device(link)	pcmcia_request_configuration(link, &link->conf)
+#endif
+
 #endif /* __BACKPORT_PCMCIA_DS_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 24/42] backports: dissolve compat-2.6.36.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (22 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 23/42] backports: dissolve compat-2.6.37.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 25/42] backports: dissolve compat-2.6.35.h Johannes Berg
                   ` (20 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/asm/ioctls.h          |   9 +
 backport/backport-include/linux/compat-2.6.36.h | 217 ------------------------
 backport/backport-include/linux/compiler.h      |   9 +
 backport/backport-include/linux/delay.h         |  10 ++
 backport/backport-include/linux/device.h        |   7 +
 backport/backport-include/linux/if.h            |  18 ++
 backport/backport-include/linux/moduleparam.h   |  12 ++
 backport/backport-include/linux/pm_qos.h        |  35 ++++
 backport/backport-include/linux/printk.h        |  19 +++
 backport/backport-include/linux/skbuff.h        |  11 ++
 backport/backport-include/linux/tty.h           |  25 +++
 backport/backport-include/linux/usb.h           |  12 ++
 backport/backport-include/linux/workqueue.h     |  49 ++++++
 backport/backport-include/pcmcia/ds.h           |  17 ++
 backport/compat/compat-2.6.36.c                 |   1 -
 backport/compat/main.c                          |   2 +-
 16 files changed, 234 insertions(+), 219 deletions(-)
 create mode 100644 backport/backport-include/asm/ioctls.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.36.h
 create mode 100644 backport/backport-include/linux/compiler.h
 create mode 100644 backport/backport-include/linux/delay.h
 create mode 100644 backport/backport-include/linux/moduleparam.h

diff --git a/backport/backport-include/asm/ioctls.h b/backport/backport-include/asm/ioctls.h
new file mode 100644
index 0000000..72c2f0a
--- /dev/null
+++ b/backport/backport-include/asm/ioctls.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_ASM_IOCTLS_H
+#define __BACKPORT_ASM_IOCTLS_H
+#include_next <asm/ioctls.h>
+
+#ifndef TIOCPKT_IOCTL
+#define TIOCPKT_IOCTL 64
+#endif
+
+#endif /* __BACKPORT_ASM_IOCTLS_H */
diff --git a/backport/backport-include/linux/compat-2.6.36.h b/backport/backport-include/linux/compat-2.6.36.h
deleted file mode 100644
index ff6a53f..0000000
--- a/backport/backport-include/linux/compat-2.6.36.h
+++ /dev/null
@@ -1,217 +0,0 @@
-#ifndef LINUX_26_36_COMPAT_H
-#define LINUX_26_36_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
-
-#include <linux/usb.h>
-#include <pcmcia/cistpl.h>
-#include <pcmcia/ds.h>
-#include <linux/pm_qos_params.h>
-#include <linux/smp_lock.h>
-
-#define kparam_block_sysfs_write(a)
-#define kparam_unblock_sysfs_write(a)
-
-/* mask va_format as RHEL6 backports this */
-#define va_format compat_va_format
-
-struct va_format {
-	const char *fmt;
-	va_list *va;
-};
-
-#define device_rename(dev, new_name) device_rename(dev, (char *)new_name)
-
-#ifdef CPTCFG_BACKPORT_OPTION_USB_URB_THREAD_FIX
-#define usb_scuttle_anchored_urbs LINUX_BACKPORT(usb_scuttle_anchored_urbs)
-#define usb_get_from_anchor LINUX_BACKPORT(usb_get_from_anchor)
-#define usb_unlink_anchored_urbs LINUX_BACKPORT(usb_unlink_anchored_urbs)
-
-extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor);
-extern struct urb *usb_get_from_anchor(struct usb_anchor *anchor);
-extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
-#endif
-
-/**
- * pcmcia_read_config_byte() - read a byte from a card configuration register
- *
- * pcmcia_read_config_byte() reads a byte from a configuration register in
- * attribute memory.
- */
-static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
-{
-        int ret;
-        conf_reg_t reg = { 0, CS_READ, where, 0 };
-        ret = pcmcia_access_configuration_register(p_dev, &reg);
-        *val = reg.Value;
-        return ret;
-}
-
-/**
- * pcmcia_write_config_byte() - write a byte to a card configuration register
- *
- * pcmcia_write_config_byte() writes a byte to a configuration register in
- * attribute memory.
- */
-static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
-{
-	conf_reg_t reg = { 0, CS_WRITE, where, val };
-	return pcmcia_access_configuration_register(p_dev, &reg);
-}
-
-struct pm_qos_request_list {
-	u32 qos;
-	void *request;
-};
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
-
-#define pm_qos_add_request(_req, _class, _value) do {			\
-	(_req)->request = #_req;					\
-	(_req)->qos = _class;						\
-	pm_qos_add_requirement((_class), (_req)->request, (_value));	\
-    } while(0)
-
-#define pm_qos_update_request(_req, _value)				\
-	pm_qos_update_requirement((_req)->qos, (_req)->request, (_value))
-
-#define pm_qos_remove_request(_req)					\
-	pm_qos_remove_requirement((_req)->qos, (_req)->request)
-
-#else
-
-#define pm_qos_add_request(_req, _class, _value) do {			\
-	(_req)->request = pm_qos_add_request((_class), (_value));	\
-    } while (0)
-
-#define pm_qos_update_request(_req, _value)				\
-	pm_qos_update_request((_req)->request, (_value))
-
-#define pm_qos_remove_request(_req)					\
-	pm_qos_remove_request((_req)->request)
-
-#endif
-
-/*
- * Dummy printk for disabled debugging statements to use whilst maintaining
- * gcc's format and side-effect checking.
- */
-/* mask no_printk as RHEL6 backports this */
-#define no_printk(a, ...) compat_no_printk(a, ##__VA_ARGS__)
-static inline __attribute__ ((format (printf, 1, 2)))
-int no_printk(const char *s, ...) { return 0; }
-
-#ifndef alloc_workqueue
-#define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active, 0)
-#endif
-
-#define EXTPROC	0200000
-#define TIOCPKT_IOCTL		64
-
-static inline void tty_lock(void) __acquires(kernel_lock)
-{
-#ifdef CONFIG_LOCK_KERNEL
-	/* kernel_locked is 1 for !CONFIG_LOCK_KERNEL */
-	WARN_ON(kernel_locked());
-#endif
-	lock_kernel();
-}
-static inline void tty_unlock(void) __releases(kernel_lock)
-{
-	unlock_kernel();
-}
-#define tty_locked()           (kernel_locked())
-
-#define usleep_range(_min, _max)	msleep((_max) / 1000)
-
-#define __rcu
-
-static inline void pm_wakeup_event(struct device *dev, unsigned int msec) {}
-
-static inline bool skb_defer_rx_timestamp(struct sk_buff *skb)
-{
-	return false;
-}
-
-static inline void skb_tx_timestamp(struct sk_buff *skb)
-{
-}
-
-/*
- * System-wide workqueues which are always present.
- *
- * system_wq is the one used by schedule[_delayed]_work[_on]().
- * Multi-CPU multi-threaded.  There are users which expect relatively
- * short queue flush time.  Don't queue works which can run for too
- * long.
- *
- * system_long_wq is similar to system_wq but may host long running
- * works.  Queue flushing might take relatively long.
- *
- * system_nrt_wq is non-reentrant and guarantees that any given work
- * item is never executed in parallel by multiple CPUs.  Queue
- * flushing might take relatively long.
- */
-#define system_wq LINUX_BACKPORT(system_wq)
-extern struct workqueue_struct *system_wq;
-#define system_long_wq LINUX_BACKPORT(system_long_wq)
-extern struct workqueue_struct *system_long_wq;
-#define system_nrt_wq LINUX_BACKPORT(system_nrt_wq)
-extern struct workqueue_struct *system_nrt_wq;
-
-void backport_system_workqueue_create(void);
-void backport_system_workqueue_destroy(void);
-
-#define schedule_work LINUX_BACKPORT(schedule_work)
-int schedule_work(struct work_struct *work);
-#define schedule_work_on LINUX_BACKPORT(schedule_work_on)
-int schedule_work_on(int cpu, struct work_struct *work);
-#define schedule_delayed_work LINUX_BACKPORT(schedule_delayed_work)
-int schedule_delayed_work(struct delayed_work *dwork,
-			  unsigned long delay);
-#define schedule_delayed_work_on LINUX_BACKPORT(schedule_delayed_work_on)
-int schedule_delayed_work_on(int cpu,
-			     struct delayed_work *dwork,
-			     unsigned long delay);
-#define flush_scheduled_work LINUX_BACKPORT(flush_scheduled_work)
-void flush_scheduled_work(void);
-
-enum {
-	/* bit mask for work_busy() return values */
-	WORK_BUSY_PENDING       = 1 << 0,
-	WORK_BUSY_RUNNING       = 1 << 1,
-};
-
-#define work_busy LINUX_BACKPORT(work_busy)
-extern unsigned int work_busy(struct work_struct *work);
-
-#define br_port_exists(dev)	(dev->br_port)
-
-#else
-
-static inline void backport_system_workqueue_create(void)
-{
-}
-
-static inline void backport_system_workqueue_destroy(void)
-{
-}
-
-/*
- * This is not part of The 2.6.37 kernel yet but we
- * we use it to optimize the backport code we
- * need to implement. Instead of using ifdefs
- * to check what version of the check we use
- * we just replace all checks on current code
- * with this. I'll submit this upstream too, that
- * way all we'd have to do is to implement this
- * for older kernels, then we would not have to
- * edit the upstrema code for backport efforts.
- */
-#define br_port_exists(dev)	(dev->priv_flags & IFF_BRIDGE_PORT)
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
-
-#endif /* LINUX_26_36_COMPAT_H */
diff --git a/backport/backport-include/linux/compiler.h b/backport/backport-include/linux/compiler.h
new file mode 100644
index 0000000..34c4a4f
--- /dev/null
+++ b/backport/backport-include/linux/compiler.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_LINUX_COMPILER_H
+#define __BACKPORT_LINUX_COMPILER_H
+#include_next <linux/compiler.h>
+
+#ifndef __rcu
+#define __rcu
+#endif
+
+#endif /* __BACKPORT_LINUX_COMPILER_H */
diff --git a/backport/backport-include/linux/delay.h b/backport/backport-include/linux/delay.h
new file mode 100644
index 0000000..1f46f58
--- /dev/null
+++ b/backport/backport-include/linux/delay.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_LINUX_DELAY_H
+#define __BACKPORT_LINUX_DELAY_H
+#include_next <linux/delay.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+#define usleep_range(_min, _max)	msleep((_max) / 1000)
+#endif
+
+#endif /* __BACKPORT_LINUX_DELAY_H */
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 54940ed..cb76099 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -86,4 +86,11 @@ do {									\
 #endif /* dynamic debug */
 #endif /* 2.6.27 <= version <= 3.5 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+#define device_rename(dev, new_name) device_rename(dev, (char *)new_name)
+
+/* this belongs into pm_wakeup.h but that isn't included directly */
+static inline void pm_wakeup_event(struct device *dev, unsigned int msec) {}
+#endif
+
 #endif /* __BACKPORT_DEVICE_H */
diff --git a/backport/backport-include/linux/if.h b/backport/backport-include/linux/if.h
index 6a8c442..53f615c 100644
--- a/backport/backport-include/linux/if.h
+++ b/backport/backport-include/linux/if.h
@@ -1,6 +1,24 @@
 #ifndef _BACKPORT_LINUX_IF_H
 #define _BACKPORT_LINUX_IF_H
 #include_next <linux/if.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
+#define br_port_exists(dev)	(dev->br_port)
+#else
+/*
+ * This is not part of The 2.6.37 kernel yet but we
+ * we use it to optimize the backport code we
+ * need to implement. Instead of using ifdefs
+ * to check what version of the check we use
+ * we just replace all checks on current code
+ * with this. I'll submit this upstream too, that
+ * way all we'd have to do is to implement this
+ * for older kernels, then we would not have to
+ * edit the upstrema code for backport efforts.
+ */
+#define br_port_exists(dev)	(dev->priv_flags & IFF_BRIDGE_PORT)
+#endif
 
 #ifndef  IFF_TX_SKB_SHARING
 #define IFF_TX_SKB_SHARING	0x10000
diff --git a/backport/backport-include/linux/moduleparam.h b/backport/backport-include/linux/moduleparam.h
new file mode 100644
index 0000000..517f50f
--- /dev/null
+++ b/backport/backport-include/linux/moduleparam.h
@@ -0,0 +1,12 @@
+#ifndef __BACKPORT_LINUX_MODULEPARAM_H
+#define __BACKPORT_LINUX_MODULEPARAM_H
+#include_next <linux/moduleparam.h>
+
+#ifndef kparam_block_sysfs_write
+#define kparam_block_sysfs_write(a)
+#endif
+#ifndef kparam_unblock_sysfs_write
+#define kparam_unblock_sysfs_write(a)
+#endif
+
+#endif /* __BACKPORT_LINUX_MODULEPARAM_H */
diff --git a/backport/backport-include/linux/pm_qos.h b/backport/backport-include/linux/pm_qos.h
index 806a20f..e49908d 100644
--- a/backport/backport-include/linux/pm_qos.h
+++ b/backport/backport-include/linux/pm_qos.h
@@ -54,4 +54,39 @@ int backport_pm_qos_power_deinit(void);
 #define PM_QOS_DEFAULT_VALUE -1
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+struct pm_qos_request_list {
+	u32 qos;
+	void *request;
+};
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
+
+#define pm_qos_add_request(_req, _class, _value) do {			\
+	(_req)->request = #_req;					\
+	(_req)->qos = _class;						\
+	pm_qos_add_requirement((_class), (_req)->request, (_value));	\
+    } while(0)
+
+#define pm_qos_update_request(_req, _value)				\
+	pm_qos_update_requirement((_req)->qos, (_req)->request, (_value))
+
+#define pm_qos_remove_request(_req)					\
+	pm_qos_remove_requirement((_req)->qos, (_req)->request)
+
+#else
+
+#define pm_qos_add_request(_req, _class, _value) do {			\
+	(_req)->request = pm_qos_add_request((_class), (_value));	\
+    } while (0)
+
+#define pm_qos_update_request(_req, _value)				\
+	pm_qos_update_request((_req)->request, (_value))
+
+#define pm_qos_remove_request(_req)					\
+	pm_qos_remove_request((_req)->request)
+
+#endif /* < 2.6.35 */
+#endif /* < 2.6.36 */
+
 #endif	/* _COMPAT_LINUX_PM_QOS_H */
diff --git a/backport/backport-include/linux/printk.h b/backport/backport-include/linux/printk.h
index 43429cf..c110888 100644
--- a/backport/backport-include/linux/printk.h
+++ b/backport/backport-include/linux/printk.h
@@ -65,4 +65,23 @@ do {                                                           \
 #endif
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+/* mask va_format as RHEL6 backports this */
+#define va_format LINUX_BACKPORT(va_format)
+
+struct va_format {
+	const char *fmt;
+	va_list *va;
+};
+
+/*
+ * Dummy printk for disabled debugging statements to use whilst maintaining
+ * gcc's format and side-effect checking.
+ */
+/* mask no_printk as RHEL6 backports this */
+#define no_printk LINUX_BACKPORT(no_printk)
+static inline __attribute__ ((format (printf, 1, 2)))
+int no_printk(const char *s, ...) { return 0; }
+#endif
+
 #endif	/* _COMPAT_LINUX_PRINTK_H */
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 52f1345..5107f65 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -91,4 +91,15 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
 }
 #endif /* < 2.6.37 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+static inline bool skb_defer_rx_timestamp(struct sk_buff *skb)
+{
+	return false;
+}
+
+static inline void skb_tx_timestamp(struct sk_buff *skb)
+{
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/tty.h b/backport/backport-include/linux/tty.h
index ec73e06..4a5a733 100644
--- a/backport/backport-include/linux/tty.h
+++ b/backport/backport-include/linux/tty.h
@@ -8,6 +8,31 @@
 extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt);
 #endif
 
+/*
+ * This really belongs into uapi/asm-generic/termbits.h but
+ * that doesn't usually get included directly.
+ */
+#ifndef EXTPROC
+#define EXTPROC	0200000
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+#include <linux/smp_lock.h>
+static inline void tty_lock(void) __acquires(kernel_lock)
+{
+#ifdef CONFIG_LOCK_KERNEL
+	/* kernel_locked is 1 for !CONFIG_LOCK_KERNEL */
+	WARN_ON(kernel_locked());
+#endif
+	lock_kernel();
+}
+static inline void tty_unlock(void) __releases(kernel_lock)
+{
+	unlock_kernel();
+}
+#define tty_locked()           (kernel_locked())
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
 /* Backports tty_lock: Localise the lock */
 #define tty_lock(__tty) tty_lock()
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index 9485d37..17cf51e 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -38,4 +38,16 @@
        .bInterfaceProtocol = (pr)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+#ifdef CPTCFG_BACKPORT_OPTION_USB_URB_THREAD_FIX
+#define usb_scuttle_anchored_urbs LINUX_BACKPORT(usb_scuttle_anchored_urbs)
+#define usb_get_from_anchor LINUX_BACKPORT(usb_get_from_anchor)
+#define usb_unlink_anchored_urbs LINUX_BACKPORT(usb_unlink_anchored_urbs)
+
+extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor);
+extern struct urb *usb_get_from_anchor(struct usb_anchor *anchor);
+extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
+#endif
+#endif
+
 #endif /* __BACKPORT_USB_H */
diff --git a/backport/backport-include/linux/workqueue.h b/backport/backport-include/linux/workqueue.h
index cc50966..79c5cf6 100644
--- a/backport/backport-include/linux/workqueue.h
+++ b/backport/backport-include/linux/workqueue.h
@@ -18,4 +18,53 @@ bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
 #define alloc_ordered_workqueue(name, flags) create_singlethread_workqueue(name)
 #endif
 
+#ifndef alloc_workqueue
+#define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active, 0)
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+#define system_wq LINUX_BACKPORT(system_wq)
+extern struct workqueue_struct *system_wq;
+#define system_long_wq LINUX_BACKPORT(system_long_wq)
+extern struct workqueue_struct *system_long_wq;
+#define system_nrt_wq LINUX_BACKPORT(system_nrt_wq)
+extern struct workqueue_struct *system_nrt_wq;
+
+void backport_system_workqueue_create(void);
+void backport_system_workqueue_destroy(void);
+
+#define schedule_work LINUX_BACKPORT(schedule_work)
+int schedule_work(struct work_struct *work);
+#define schedule_work_on LINUX_BACKPORT(schedule_work_on)
+int schedule_work_on(int cpu, struct work_struct *work);
+#define schedule_delayed_work LINUX_BACKPORT(schedule_delayed_work)
+int schedule_delayed_work(struct delayed_work *dwork,
+			  unsigned long delay);
+#define schedule_delayed_work_on LINUX_BACKPORT(schedule_delayed_work_on)
+int schedule_delayed_work_on(int cpu,
+			     struct delayed_work *dwork,
+			     unsigned long delay);
+#define flush_scheduled_work LINUX_BACKPORT(flush_scheduled_work)
+void flush_scheduled_work(void);
+
+enum {
+	/* bit mask for work_busy() return values */
+	WORK_BUSY_PENDING       = 1 << 0,
+	WORK_BUSY_RUNNING       = 1 << 1,
+};
+
+#define work_busy LINUX_BACKPORT(work_busy)
+extern unsigned int work_busy(struct work_struct *work);
+
+#else
+
+static inline void backport_system_workqueue_create(void)
+{
+}
+
+static inline void backport_system_workqueue_destroy(void)
+{
+}
+#endif /* < 2.6.36 */
+
 #endif /* __BACKPORT_LINUX_WORKQUEUE_H */
diff --git a/backport/backport-include/pcmcia/ds.h b/backport/backport-include/pcmcia/ds.h
index 02f851f..7c49500 100644
--- a/backport/backport-include/pcmcia/ds.h
+++ b/backport/backport-include/pcmcia/ds.h
@@ -30,4 +30,21 @@
 #define pcmcia_enable_device(link)	pcmcia_request_configuration(link, &link->conf)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
+{
+        int ret;
+        conf_reg_t reg = { 0, CS_READ, where, 0 };
+        ret = pcmcia_access_configuration_register(p_dev, &reg);
+        *val = reg.Value;
+        return ret;
+}
+
+static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
+{
+	conf_reg_t reg = { 0, CS_WRITE, where, val };
+	return pcmcia_access_configuration_register(p_dev, &reg);
+}
+#endif
+
 #endif /* __BACKPORT_PCMCIA_DS_H */
diff --git a/backport/compat/compat-2.6.36.c b/backport/compat/compat-2.6.36.c
index 522205a..92ef827 100644
--- a/backport/compat/compat-2.6.36.c
+++ b/backport/compat/compat-2.6.36.c
@@ -10,7 +10,6 @@
 
 #include <linux/compat.h>
 #include <linux/usb.h>
-#include <linux/compat-2.6.36.h>
 
 #ifdef CPTCFG_BACKPORT_OPTION_USB_URB_THREAD_FIX
 /* Callers must hold anchor->lock */
diff --git a/backport/compat/main.c b/backport/compat/main.c
index 4cc93c3..90ce751 100644
--- a/backport/compat/main.c
+++ b/backport/compat/main.c
@@ -1,7 +1,7 @@
 #include <linux/module.h>
 #include <linux/pm_qos.h>
+#include <linux/workqueue.h>
 #include "compat-2.6.34.h"
-#include <linux/compat-2.6.36.h>
 
 MODULE_AUTHOR("Luis R. Rodriguez");
 MODULE_DESCRIPTION("Kernel backport module");
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 25/42] backports: dissolve compat-2.6.35.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (23 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 24/42] backports: dissolve compat-2.6.36.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 26/42] backports: dissolve compat-2.6.34.h Johannes Berg
                   ` (19 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-2.6.35.h | 100 ------------------------
 backport/backport-include/linux/etherdevice.h   |   4 +
 backport/backport-include/linux/fs.h            |   9 +++
 backport/backport-include/linux/hid.h           |  10 +++
 backport/backport-include/linux/interrupt.h     |  15 ++++
 backport/backport-include/linux/kernel.h        |  17 ++++
 backport/backport-include/linux/mmc/sdio.h      |   7 ++
 backport/backport-include/linux/mmc/sdio_func.h |  10 +++
 backport/backport-include/linux/netdevice.h     |  17 ++++
 backport/backport-include/linux/pm_qos.h        |   4 +
 backport/backport-include/linux/usb.h           |  13 +++
 backport/backport-include/net/sch_generic.h     |  26 ++++++
 backport/backport-include/net/sock.h            |   7 ++
 13 files changed, 139 insertions(+), 100 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.35.h
 create mode 100644 backport/backport-include/linux/mmc/sdio_func.h

diff --git a/backport/backport-include/linux/compat-2.6.35.h b/backport/backport-include/linux/compat-2.6.35.h
deleted file mode 100644
index cb43472..0000000
--- a/backport/backport-include/linux/compat-2.6.35.h
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef LINUX_26_35_COMPAT_H
-#define LINUX_26_35_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
-#include <linux/etherdevice.h>
-#include <net/sock.h>
-#include <linux/types.h>
-#include <linux/usb.h>
-#include <linux/spinlock.h>
-#include <net/sch_generic.h>
-
-#define HID_QUIRK_NO_IGNORE                    0x40000000
-#define HID_QUIRK_HIDDEV_FORCE                 0x00000010
-
-/* added on linux/kernel.h */
-#define USHRT_MAX      ((u16)(~0U))
-#define SHRT_MAX       ((s16)(USHRT_MAX>>1))
-#define SHRT_MIN       ((s16)(-SHRT_MAX - 1))
-
-#define  SDIO_BUS_ECSI		0x20	/* Enable continuous SPI interrupt */
-#define  SDIO_BUS_SCSI		0x40	/* Support continuous SPI interrupt */
-
-#define netdev_hw_addr dev_mc_list
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
-
-#define qdisc_reset_all_tx_gt LINUX_BACKPORT(qdisc_reset_all_tx_gt)
-
-/* Reset all TX qdiscs greater then index of a device.  */
-static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
-{
-	struct Qdisc *qdisc;
-
-	for (; i < dev->num_tx_queues; i++) {
-		qdisc = netdev_get_tx_queue(dev, i)->qdisc;
-		if (qdisc) {
-			spin_lock_bh(qdisc_lock(qdisc));
-			qdisc_reset(qdisc);
-			spin_unlock_bh(qdisc_lock(qdisc));
-		}
-	}
-}
-#else
-static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
-{
-}
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) */
-
-#define netif_set_real_num_tx_queues LINUX_BACKPORT(netif_set_real_num_tx_queues)
-extern int netif_set_real_num_tx_queues(struct net_device *dev,
-					unsigned int txq);
-
-/* mask irq_set_affinity_hint as RHEL6 backports this */
-#define irq_set_affinity_hint(a,b) compat_irq_set_affinity_hint(a,b)
-/*
- * We cannot backport this guy as the IRQ data structure
- * was modified in the kernel itself to support this. We
- * treat the system as uni-processor in this case.
- */
-static inline int irq_set_affinity_hint(unsigned int irq,
-					const struct cpumask *m)
-{
-	return -EINVAL;
-}
-
-static inline wait_queue_head_t *sk_sleep(struct sock *sk)
-{
-	return sk->sk_sleep;
-}
-
-#define sdio_writeb_readb(func, write_byte, addr, err_ret) sdio_readb(func, addr, err_ret)
-
-#define hex_to_bin LINUX_BACKPORT(hex_to_bin)
-int hex_to_bin(char ch);
-
-#define noop_llseek LINUX_BACKPORT(noop_llseek)
-extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
-
-#define pm_qos_request(_qos) pm_qos_requirement(_qos)
-
-/* mask usb_pipe_endpoint as RHEL6 backports this */
-#define usb_pipe_endpoint(a,b) compat_usb_pipe_endpoint(a,b)
-
-static inline struct usb_host_endpoint *
-usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe)
-{
-	struct usb_host_endpoint **eps;
-	eps = usb_pipein(pipe) ? dev->ep_in : dev->ep_out;
-	return eps[usb_pipeendpoint(pipe)];
-}
-
-#define simple_write_to_buffer LINUX_BACKPORT(simple_write_to_buffer)
-extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
-		const void __user *from, size_t count);
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */
-
-#endif /* LINUX_26_35_COMPAT_H */
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index 43dcba0..b35735d 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -103,4 +103,8 @@ static inline int is_unicast_ether_addr(const u8 *addr)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#define netdev_hw_addr dev_mc_list
+#endif
+
 #endif /* _BACKPORT_LINUX_ETHERDEVICE_H */
diff --git a/backport/backport-include/linux/fs.h b/backport/backport-include/linux/fs.h
index b441236..9de5109 100644
--- a/backport/backport-include/linux/fs.h
+++ b/backport/backport-include/linux/fs.h
@@ -29,4 +29,13 @@ static inline struct inode *file_inode(struct file *f)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#define noop_llseek LINUX_BACKPORT(noop_llseek)
+extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
+
+#define simple_write_to_buffer LINUX_BACKPORT(simple_write_to_buffer)
+extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
+		const void __user *from, size_t count);
+#endif
+
 #endif	/* _COMPAT_LINUX_FS_H */
diff --git a/backport/backport-include/linux/hid.h b/backport/backport-include/linux/hid.h
index 815eec4..b642ece 100644
--- a/backport/backport-include/linux/hid.h
+++ b/backport/backport-include/linux/hid.h
@@ -12,4 +12,14 @@ extern bool hid_ignore(struct hid_device *);
 #define HID_TYPE_USBNONE 2
 #endif
 
+#ifndef HID_QUIRK_NO_IGNORE
+#define HID_QUIRK_NO_IGNORE                    0x40000000
+#endif
+
+#ifndef HID_QUIRK_HIDDEV_FORCE
+#define HID_QUIRK_HIDDEV_FORCE                 0x00000010
+#endif
+
+
+
 #endif /* __BACKPORT_HID_H */
diff --git a/backport/backport-include/linux/interrupt.h b/backport/backport-include/linux/interrupt.h
index 79937a6..908ef36 100644
--- a/backport/backport-include/linux/interrupt.h
+++ b/backport/backport-include/linux/interrupt.h
@@ -10,4 +10,19 @@ static inline int irq_set_irq_wake(unsigned int irq, unsigned int on)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+/* mask irq_set_affinity_hint as RHEL6 backports this */
+#define irq_set_affinity_hint LINUX_BACKPORT(irq_set_affinity_hint)
+/*
+ * We cannot backport this guy as the IRQ data structure
+ * was modified in the kernel itself to support this. We
+ * treat the system as uni-processor in this case.
+ */
+static inline int irq_set_affinity_hint(unsigned int irq,
+					const struct cpumask *m)
+{
+	return -EINVAL;
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_INTERRUPT_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index 5fdcdc0..dafcc33 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -167,4 +167,21 @@ int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
 
 #endif /* < 2.6.39 */
 
+#ifndef USHRT_MAX
+#define USHRT_MAX      ((u16)(~0U))
+#endif
+
+#ifndef SHRT_MAX
+#define SHRT_MAX       ((s16)(USHRT_MAX>>1))
+#endif
+
+#ifndef SHRT_MIN
+#define SHRT_MIN       ((s16)(-SHRT_MAX - 1))
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#define hex_to_bin LINUX_BACKPORT(hex_to_bin)
+int hex_to_bin(char ch);
+#endif
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/mmc/sdio.h b/backport/backport-include/linux/mmc/sdio.h
index 9bdbdc5..31d8833 100644
--- a/backport/backport-include/linux/mmc/sdio.h
+++ b/backport/backport-include/linux/mmc/sdio.h
@@ -11,4 +11,11 @@
 #define  SDIO_SDIO_REV_3_00    4       /* SDIO Spec Version 3.00 */
 #endif
 
+#ifndef SDIO_BUS_ECSI
+#define  SDIO_BUS_ECSI		0x20	/* Enable continuous SPI interrupt */
+#endif
+#ifndef SDIO_BUS_SCSI
+#define  SDIO_BUS_SCSI		0x40	/* Support continuous SPI interrupt */
+#endif
+
 #endif /* __BACKPORT_MMC_SDIO_H */
diff --git a/backport/backport-include/linux/mmc/sdio_func.h b/backport/backport-include/linux/mmc/sdio_func.h
new file mode 100644
index 0000000..9f720a2
--- /dev/null
+++ b/backport/backport-include/linux/mmc/sdio_func.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_MMC_SDIO_FUNC_H
+#define __BACKPORT_MMC_SDIO_FUNC_H
+#include <linux/version.h>
+#include_next <linux/mmc/sdio_func.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#define sdio_writeb_readb(func, write_byte, addr, err_ret) sdio_readb(func, addr, err_ret)
+#endif
+
+#endif /* __BACKPORT_MMC_SDIO_FUNC_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 72cd504..cba926b 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -111,4 +111,21 @@ static inline int netif_set_real_num_rx_queues(struct net_device *dev,
 #endif
 #endif /* < 2.6.37 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+/*
+ * etherdevice.h requires netdev_hw_addr to not have been redefined,
+ * so while generally we shouldn't/wouldn't include unrelated header
+ * files here it's unavoidable. However, if we got included through
+ * it, then we let it sort out the netdev_hw_addr define so that it
+ * still gets the correct one later ...
+ */
+#include <linux/etherdevice.h>
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#define netif_set_real_num_tx_queues LINUX_BACKPORT(netif_set_real_num_tx_queues)
+extern int netif_set_real_num_tx_queues(struct net_device *dev,
+					unsigned int txq);
+#endif
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/pm_qos.h b/backport/backport-include/linux/pm_qos.h
index e49908d..96a600f 100644
--- a/backport/backport-include/linux/pm_qos.h
+++ b/backport/backport-include/linux/pm_qos.h
@@ -89,4 +89,8 @@ struct pm_qos_request_list {
 #endif /* < 2.6.35 */
 #endif /* < 2.6.36 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#define pm_qos_request(_qos) pm_qos_requirement(_qos)
+#endif
+
 #endif	/* _COMPAT_LINUX_PM_QOS_H */
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index 17cf51e..3e820f0 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -50,4 +50,17 @@ extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
 #endif
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+/* mask usb_pipe_endpoint as RHEL6 backports this */
+#define usb_pipe_endpoint LINUX_BACKPORT(usb_pipe_endpoint)
+
+static inline struct usb_host_endpoint *
+usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe)
+{
+	struct usb_host_endpoint **eps;
+	eps = usb_pipein(pipe) ? dev->ep_in : dev->ep_out;
+	return eps[usb_pipeendpoint(pipe)];
+}
+#endif
+
 #endif /* __BACKPORT_USB_H */
diff --git a/backport/backport-include/net/sch_generic.h b/backport/backport-include/net/sch_generic.h
index 0e4a2be..63ac16e 100644
--- a/backport/backport-include/net/sch_generic.h
+++ b/backport/backport-include/net/sch_generic.h
@@ -54,4 +54,30 @@ static inline void qdisc_bstats_update(struct Qdisc *sch,
 #endif
 #endif /* < 2.6.38 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+
+#define qdisc_reset_all_tx_gt LINUX_BACKPORT(qdisc_reset_all_tx_gt)
+
+/* Reset all TX qdiscs greater then index of a device.  */
+static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
+{
+	struct Qdisc *qdisc;
+
+	for (; i < dev->num_tx_queues; i++) {
+		qdisc = netdev_get_tx_queue(dev, i)->qdisc;
+		if (qdisc) {
+			spin_lock_bh(qdisc_lock(qdisc));
+			qdisc_reset(qdisc);
+			spin_unlock_bh(qdisc_lock(qdisc));
+		}
+	}
+}
+#else
+static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
+{
+}
+#endif /* >= 2.6.27 */
+#endif /* < 2.6.35 */
+
 #endif /* __BACKPORT_NET_SCH_GENERIC_H */
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
index ec67b9e..4e1141f 100644
--- a/backport/backport-include/net/sock.h
+++ b/backport/backport-include/net/sock.h
@@ -38,4 +38,11 @@
 #define SOCK_SELECT_ERR_QUEUE (SOCK_QUEUE_SHRUNK + 14)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+static inline wait_queue_head_t *sk_sleep(struct sock *sk)
+{
+	return sk->sk_sleep;
+}
+#endif
+
 #endif /* __BACKPORT_NET_SOCK_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 26/42] backports: dissolve compat-2.6.34.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (24 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 25/42] backports: dissolve compat-2.6.35.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 27/42] backports: dissolve compat-2.6.33.h Johannes Berg
                   ` (18 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-2.6.34.h | 347 ------------------------
 backport/backport-include/linux/device.h        |  29 ++
 backport/backport-include/linux/dma-mapping.h   |  32 +++
 backport/backport-include/linux/input.h         |   4 +
 backport/backport-include/linux/kernel.h        |   6 +
 backport/backport-include/linux/mmc/sdio_func.h |  20 ++
 backport/backport-include/linux/netdevice.h     | 149 ++++++++++
 backport/backport-include/linux/rcupdate.h      |  22 ++
 backport/backport-include/linux/rtnetlink.h     |  14 +
 backport/backport-include/linux/seq_file.h      |  10 +
 backport/backport-include/linux/sysfs.h         |  34 +++
 backport/backport-include/linux/usb.h           |  11 +
 backport/backport-include/net/sock.h            |   7 +
 backport/backport-include/pcmcia/device_id.h    |   7 +
 14 files changed, 345 insertions(+), 347 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.34.h
 create mode 100644 backport/backport-include/linux/sysfs.h

diff --git a/backport/backport-include/linux/compat-2.6.34.h b/backport/backport-include/linux/compat-2.6.34.h
deleted file mode 100644
index d444853..0000000
--- a/backport/backport-include/linux/compat-2.6.34.h
+++ /dev/null
@@ -1,347 +0,0 @@
-#ifndef LINUX_26_34_COMPAT_H
-#define LINUX_26_34_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34))
-
-#include <linux/netdevice.h>
-#include <linux/usb.h>
-#include <linux/mmc/sdio_func.h>
-#include <net/sock.h>
-
-/*
- * Backports da68c4eb25
- * sdio: introduce API for special power management features
- *
- * We wimply carry around the data structures and flags, and
- * make the host return no flags set by the driver.
- */
-typedef unsigned int mmc_pm_flag_t;
-
-#define MMC_PM_KEEP_POWER      (1 << 0)        /* preserve card power during suspend */
-#define MMC_PM_WAKE_SDIO_IRQ   (1 << 1)        /* wake up host system on SDIO IRQ assertion */
-
-extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
-extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
-
-#define netdev_mc_count(dev) ((dev)->mc_count)
-#define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0)
-
-/* mask netdev_for_each_mc_addr as RHEL6 backports this */
-#if !defined(netdev_for_each_mc_addr)
-#define netdev_for_each_mc_addr(mclist, dev) \
-	for (mclist = dev->mc_list; mclist; mclist = mclist->next)
-#endif
-/* source: include/linux/netdevice.h */
-
-
-/* Logging, debugging and troubleshooting/diagnostic helpers. */
-
-/* netdev_printk helpers, similar to dev_printk */
-
-#ifndef netdev_name
-#define netdev_name(__dev) \
-	((__dev->reg_state != NETREG_REGISTERED) ? \
-		"(unregistered net_device)" : __dev->name)
-#endif
-
-#define netdev_printk(level, netdev, format, args...)		\
-	dev_printk(level, (netdev)->dev.parent,			\
-		   "%s: " format,				\
-		   netdev_name(netdev), ##args)
-
-#define netdev_emerg(dev, format, args...)			\
-	netdev_printk(KERN_EMERG, dev, format, ##args)
-#define netdev_alert(dev, format, args...)			\
-	netdev_printk(KERN_ALERT, dev, format, ##args)
-#define netdev_crit(dev, format, args...)			\
-	netdev_printk(KERN_CRIT, dev, format, ##args)
-#define netdev_err(dev, format, args...)			\
-	netdev_printk(KERN_ERR, dev, format, ##args)
-#define netdev_warn(dev, format, args...)			\
-	netdev_printk(KERN_WARNING, dev, format, ##args)
-#define netdev_notice(dev, format, args...)			\
-	netdev_printk(KERN_NOTICE, dev, format, ##args)
-#define netdev_info(dev, format, args...)			\
-	netdev_printk(KERN_INFO, dev, format, ##args)
-
-/* mask netdev_dbg as RHEL6 backports this */
-#if !defined(netdev_dbg)
-
-#if defined(DEBUG)
-#define netdev_dbg(__dev, format, args...)			\
-	netdev_printk(KERN_DEBUG, __dev, format, ##args)
-#elif defined(CONFIG_DYNAMIC_DEBUG)
-#define netdev_dbg(__dev, format, args...)			\
-do {								\
-	dynamic_dev_dbg((__dev)->dev.parent, "%s: " format,	\
-			netdev_name(__dev), ##args);		\
-} while (0)
-#else
-#define netdev_dbg(__dev, format, args...)			\
-({								\
-	if (0)							\
-		netdev_printk(KERN_DEBUG, __dev, format, ##args); \
-	0;							\
-})
-#endif
-
-#endif
-
-/* mask netdev_vdbg as RHEL6 backports this */
-#if !defined(netdev_dbg)
-
-#if defined(VERBOSE_DEBUG)
-#define netdev_vdbg	netdev_dbg
-#else
-
-#define netdev_vdbg(dev, format, args...)			\
-({								\
-	if (0)							\
-		netdev_printk(KERN_DEBUG, dev, format, ##args);	\
-	0;							\
-})
-#endif
-
-#endif
-
-/*
- * netdev_WARN() acts like dev_printk(), but with the key difference
- * of using a WARN/WARN_ON to get the message out, including the
- * file/line information and a backtrace.
- */
-#define netdev_WARN(dev, format, args...)			\
-	WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args);
-
-/* netif printk helpers, similar to netdev_printk */
-
-#define netif_printk(priv, type, level, dev, fmt, args...)	\
-do {					  			\
-	if (netif_msg_##type(priv))				\
-		netdev_printk(level, (dev), fmt, ##args);	\
-} while (0)
-
-#define netif_emerg(priv, type, dev, fmt, args...)		\
-	netif_printk(priv, type, KERN_EMERG, dev, fmt, ##args)
-#define netif_alert(priv, type, dev, fmt, args...)		\
-	netif_printk(priv, type, KERN_ALERT, dev, fmt, ##args)
-#define netif_crit(priv, type, dev, fmt, args...)		\
-	netif_printk(priv, type, KERN_CRIT, dev, fmt, ##args)
-#define netif_err(priv, type, dev, fmt, args...)		\
-	netif_printk(priv, type, KERN_ERR, dev, fmt, ##args)
-#define netif_warn(priv, type, dev, fmt, args...)		\
-	netif_printk(priv, type, KERN_WARNING, dev, fmt, ##args)
-#define netif_notice(priv, type, dev, fmt, args...)		\
-	netif_printk(priv, type, KERN_NOTICE, dev, fmt, ##args)
-#define netif_info(priv, type, dev, fmt, args...)		\
-	netif_printk(priv, type, KERN_INFO, (dev), fmt, ##args)
-
-/* mask netif_dbg as RHEL6 backports this */
-#if !defined(netif_dbg)
-
-#if defined(DEBUG)
-#define netif_dbg(priv, type, dev, format, args...)		\
-	netif_printk(priv, type, KERN_DEBUG, dev, format, ##args)
-#elif defined(CONFIG_DYNAMIC_DEBUG)
-#define netif_dbg(priv, type, netdev, format, args...)		\
-do {								\
-	if (netif_msg_##type(priv))				\
-		dynamic_dev_dbg((netdev)->dev.parent,		\
-				"%s: " format,			\
-				netdev_name(netdev), ##args);	\
-} while (0)
-#else
-#define netif_dbg(priv, type, dev, format, args...)			\
-({									\
-	if (0)								\
-		netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
-	0;								\
-})
-#endif
-
-#endif
-
-/* mask netif_vdbg as RHEL6 backports this */
-#if !defined(netif_vdbg)
-
-#if defined(VERBOSE_DEBUG)
-#define netif_vdbg	netdev_dbg
-#else
-#define netif_vdbg(priv, type, dev, format, args...)		\
-({								\
-	if (0)							\
-		netif_printk(KERN_DEBUG, dev, format, ##args);	\
-	0;							\
-})
-#endif
-#endif
-/* source: include/linux/netdevice.h */
-
-
-static inline void device_lock(struct device *dev)
-{
-#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT_DESKTOP)
-        mutex_lock(&dev->mutex);
-#else
-	down(&dev->sem);
-#endif
-}
-
-static inline int device_trylock(struct device *dev)
-{
-#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT_DESKTOP)
-	return mutex_trylock(&dev->mutex);
-#else
-	return down_trylock(&dev->sem);
-#endif
-}
-
-static inline void device_unlock(struct device *dev)
-{
-#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT_DESKTOP)
-        mutex_unlock(&dev->mutex);
-#else
-	up(&dev->sem);
-#endif
-}
-
-#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
-#define PCMCIA_DEVICE_PROD_ID3(v3, vh3) { \
-	.match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID3, \
-	.prod_id = { NULL, NULL, (v3), NULL },  \
-	.prod_id_hash = { 0, 0, (vh3), 0 }, }
-#endif
-
-#define rcu_dereference_check(p, c) rcu_dereference(p)
-
-/**
- *	sysfs_attr_init - initialize a dynamically allocated sysfs attribute
- *	@attr: struct attribute to initialize
- *
- *	Initialize a dynamically allocated struct attribute so we can
- *	make lockdep happy.  This is a new requirement for attributes
- *	and initially this is only needed when lockdep is enabled.
- *	Lockdep gives a nice error when your attribute is added to
- *	sysfs if you don't have this.
- */
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-#define sysfs_attr_init(attr)				\
-do {							\
-	static struct lock_class_key __key;		\
-							\
-	(attr)->key = &__key;				\
-} while(0)
-#else
-#define sysfs_attr_init(attr) do {} while(0)
-#endif
-
-/* mask sysfs_bin_attr_init as RHEL6 backports this */
-#if !defined(sysfs_bin_attr_init)
-/**
- *	sysfs_bin_attr_init - initialize a dynamically allocated bin_attribute
- *	@attr: struct bin_attribute to initialize
- *
- *	Initialize a dynamically allocated struct bin_attribute so we
- *	can make lockdep happy.  This is a new requirement for
- *	attributes and initially this is only needed when lockdep is
- *	enabled.  Lockdep gives a nice error when your attribute is
- *	added to sysfs if you don't have this.
- */
-#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr)
-#endif
-
-#define usb_alloc_coherent(dev, size, mem_flags, dma) usb_buffer_alloc(dev, size, mem_flags, dma)
-#define usb_free_coherent(dev, size, addr, dma) usb_buffer_free(dev, size, addr, dma)
-
-/* only include this if DEFINE_DMA_UNMAP_ADDR is not set as debian squeeze also backports this  */
-#ifndef DEFINE_DMA_UNMAP_ADDR
-#ifdef CONFIG_NEED_DMA_MAP_STATE
-#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)        dma_addr_t ADDR_NAME
-#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)          __u32 LEN_NAME
-#define dma_unmap_addr(PTR, ADDR_NAME)           ((PTR)->ADDR_NAME)
-#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL)  (((PTR)->ADDR_NAME) = (VAL))
-#define dma_unmap_len(PTR, LEN_NAME)             ((PTR)->LEN_NAME)
-#define dma_unmap_len_set(PTR, LEN_NAME, VAL)    (((PTR)->LEN_NAME) = (VAL))
-#else
-#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)
-#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)
-#define dma_unmap_addr(PTR, ADDR_NAME)           (0)
-#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL)  do { } while (0)
-#define dma_unmap_len(PTR, LEN_NAME)             (0)
-#define dma_unmap_len_set(PTR, LEN_NAME, VAL)    do { } while (0)
-#endif
-#endif
-
-/* mask dma_set_coherent_mask as debian squeeze also backports this */
-#define dma_set_coherent_mask(a, b) compat_dma_set_coherent_mask(a, b)
-
-static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
-{
-	if (!dma_supported(dev, mask))
-		return -EIO;
-	dev->coherent_dma_mask = mask;
-	return 0;
-}
-
-/* USB autosuspend and autoresume */
-static inline int usb_enable_autosuspend(struct usb_device *udev)
-{ return 0; }
-static inline int usb_disable_autosuspend(struct usb_device *udev)
-{ return 0; }
-
-#if !defined(rcu_dereference_protected)
-#define rcu_dereference_protected(p, c) (p)
-#endif
-#define rcu_access_pointer(p)   ACCESS_ONCE(p)
-
-#define rcu_dereference_raw(p)	rcu_dereference(p)
-
-#define KEY_WPS_BUTTON		0x211	/* WiFi Protected Setup key */
-
-/*
- * This looks more complex than it should be. But we need to
- * get the type for the ~ right in round_down (it needs to be
- * as wide as the result!), and we want to evaluate the macro
- * arguments just once each.
- */
-#define __round_mask(x, y) ((__typeof__(x))((y)-1))
-#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
-#define round_down(x, y) ((x) & ~__round_mask(x, y))
-
-static inline int rcu_read_lock_held(void)
-{
-	return 1;
-}
-
-#ifdef CONFIG_PROVE_LOCKING
-/*
- * Obviously, this is wrong.  But the base kernel will have rtnl_mutex
- * declared static, with no way to access it.  I think this is the best
- * we can do...
- */
-static inline int lockdep_rtnl_is_held(void)
-{
-        return 1;
-}
-#endif /* #ifdef CONFIG_PROVE_LOCKING */
-
-#define seq_hlist_start_head LINUX_BACKPORT(seq_hlist_start_head)
-extern struct hlist_node *seq_hlist_start_head(struct hlist_head *head,
-					       loff_t pos);
-
-#define seq_hlist_next LINUX_BACKPORT(seq_hlist_next)
-extern struct hlist_node *seq_hlist_next(void *v, struct hlist_head *head,
-					 loff_t *ppos);
-
-static inline struct sock *sk_entry(const struct hlist_node *node)
-{
-	return hlist_entry(node, struct sock, sk_node);
-}
-
-#else /* Kernels >= 2.6.34 */
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)) */
-
-
-#endif /* LINUX_26_34_COMPAT_H */
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index cb76099..0e45c1b 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -93,4 +93,33 @@ do {									\
 static inline void pm_wakeup_event(struct device *dev, unsigned int msec) {}
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+static inline void device_lock(struct device *dev)
+{
+#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT_DESKTOP)
+        mutex_lock(&dev->mutex);
+#else
+	down(&dev->sem);
+#endif
+}
+
+static inline int device_trylock(struct device *dev)
+{
+#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT_DESKTOP)
+	return mutex_trylock(&dev->mutex);
+#else
+	return down_trylock(&dev->sem);
+#endif
+}
+
+static inline void device_unlock(struct device *dev)
+{
+#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT_DESKTOP)
+        mutex_unlock(&dev->mutex);
+#else
+	up(&dev->sem);
+#endif
+}
+#endif
+
 #endif /* __BACKPORT_DEVICE_H */
diff --git a/backport/backport-include/linux/dma-mapping.h b/backport/backport-include/linux/dma-mapping.h
index 091e505..540355a 100644
--- a/backport/backport-include/linux/dma-mapping.h
+++ b/backport/backport-include/linux/dma-mapping.h
@@ -14,4 +14,36 @@ static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+/* only include this if DEFINE_DMA_UNMAP_ADDR is not set as debian squeeze also backports this  */
+#ifndef DEFINE_DMA_UNMAP_ADDR
+#ifdef CONFIG_NEED_DMA_MAP_STATE
+#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)        dma_addr_t ADDR_NAME
+#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)          __u32 LEN_NAME
+#define dma_unmap_addr(PTR, ADDR_NAME)           ((PTR)->ADDR_NAME)
+#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL)  (((PTR)->ADDR_NAME) = (VAL))
+#define dma_unmap_len(PTR, LEN_NAME)             ((PTR)->LEN_NAME)
+#define dma_unmap_len_set(PTR, LEN_NAME, VAL)    (((PTR)->LEN_NAME) = (VAL))
+#else
+#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)
+#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)
+#define dma_unmap_addr(PTR, ADDR_NAME)           (0)
+#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL)  do { } while (0)
+#define dma_unmap_len(PTR, LEN_NAME)             (0)
+#define dma_unmap_len_set(PTR, LEN_NAME, VAL)    do { } while (0)
+#endif
+#endif
+
+/* mask dma_set_coherent_mask as debian squeeze also backports this */
+#define dma_set_coherent_mask LINUX_BACKPORT(dma_set_coherent_mask)
+
+static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
+{
+	if (!dma_supported(dev, mask))
+		return -EIO;
+	dev->coherent_dma_mask = mask;
+	return 0;
+}
+#endif /* < 2.6.34 */
+
 #endif /* __BACKPORT_LINUX_DMA_MAPPING_H */
diff --git a/backport/backport-include/linux/input.h b/backport/backport-include/linux/input.h
index 588b4f6..0d58f9b 100644
--- a/backport/backport-include/linux/input.h
+++ b/backport/backport-include/linux/input.h
@@ -6,4 +6,8 @@
 #define KEY_WIMAX		246
 #endif
 
+#ifndef KEY_WPS_BUTTON
+#define KEY_WPS_BUTTON		0x211
+#endif
+
 #endif /* __BACKPORT_INPUT_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index dafcc33..f189f54 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -184,4 +184,10 @@ int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
 int hex_to_bin(char ch);
 #endif
 
+#ifndef __round_mask
+#define __round_mask(x, y) ((__typeof__(x))((y)-1))
+#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
+#define round_down(x, y) ((x) & ~__round_mask(x, y))
+#endif
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/mmc/sdio_func.h b/backport/backport-include/linux/mmc/sdio_func.h
index 9f720a2..62f89a5 100644
--- a/backport/backport-include/linux/mmc/sdio_func.h
+++ b/backport/backport-include/linux/mmc/sdio_func.h
@@ -7,4 +7,24 @@
 #define sdio_writeb_readb(func, write_byte, addr, err_ret) sdio_readb(func, addr, err_ret)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+/*
+ * Backports da68c4eb25
+ * sdio: introduce API for special power management features
+ *
+ * We simply carry around the data structures and flags, and
+ * make the host return no flags set by the driver.
+ *
+ * This is declared in mmc/pm.h upstream, but that files
+ * didn't exist before this commit and isn't included directly.
+ */
+typedef unsigned int mmc_pm_flag_t;
+
+#define MMC_PM_KEEP_POWER      (1 << 0)        /* preserve card power during suspend */
+#define MMC_PM_WAKE_SDIO_IRQ   (1 << 1)        /* wake up host system on SDIO IRQ assertion */
+
+extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
+extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
+#endif
+
 #endif /* __BACKPORT_MMC_SDIO_FUNC_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index cba926b..b18d9c7 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -128,4 +128,153 @@ extern int netif_set_real_num_tx_queues(struct net_device *dev,
 					unsigned int txq);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+#define netdev_mc_count(dev) ((dev)->mc_count)
+#define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0)
+
+/* mask netdev_for_each_mc_addr as RHEL6 backports this */
+#ifndef netdev_for_each_mc_addr
+#define netdev_for_each_mc_addr(mclist, dev) \
+	for (mclist = dev->mc_list; mclist; mclist = mclist->next)
+#endif
+
+#ifndef netdev_name
+#define netdev_name(__dev) \
+	((__dev->reg_state != NETREG_REGISTERED) ? \
+		"(unregistered net_device)" : __dev->name)
+#endif
+
+#define netdev_printk(level, netdev, format, args...)		\
+	dev_printk(level, (netdev)->dev.parent,			\
+		   "%s: " format,				\
+		   netdev_name(netdev), ##args)
+
+#define netdev_emerg(dev, format, args...)			\
+	netdev_printk(KERN_EMERG, dev, format, ##args)
+#define netdev_alert(dev, format, args...)			\
+	netdev_printk(KERN_ALERT, dev, format, ##args)
+#define netdev_crit(dev, format, args...)			\
+	netdev_printk(KERN_CRIT, dev, format, ##args)
+#define netdev_err(dev, format, args...)			\
+	netdev_printk(KERN_ERR, dev, format, ##args)
+#define netdev_warn(dev, format, args...)			\
+	netdev_printk(KERN_WARNING, dev, format, ##args)
+#define netdev_notice(dev, format, args...)			\
+	netdev_printk(KERN_NOTICE, dev, format, ##args)
+#define netdev_info(dev, format, args...)			\
+	netdev_printk(KERN_INFO, dev, format, ##args)
+
+/* mask netdev_dbg as RHEL6 backports this */
+#if !defined(netdev_dbg)
+
+#if defined(DEBUG)
+#define netdev_dbg(__dev, format, args...)			\
+	netdev_printk(KERN_DEBUG, __dev, format, ##args)
+#elif defined(CONFIG_DYNAMIC_DEBUG)
+#define netdev_dbg(__dev, format, args...)			\
+do {								\
+	dynamic_dev_dbg((__dev)->dev.parent, "%s: " format,	\
+			netdev_name(__dev), ##args);		\
+} while (0)
+#else
+#define netdev_dbg(__dev, format, args...)			\
+({								\
+	if (0)							\
+		netdev_printk(KERN_DEBUG, __dev, format, ##args); \
+	0;							\
+})
+#endif
+
+#endif
+
+/* mask netdev_vdbg as RHEL6 backports this */
+#if !defined(netdev_dbg)
+
+#if defined(VERBOSE_DEBUG)
+#define netdev_vdbg	netdev_dbg
+#else
+
+#define netdev_vdbg(dev, format, args...)			\
+({								\
+	if (0)							\
+		netdev_printk(KERN_DEBUG, dev, format, ##args);	\
+	0;							\
+})
+#endif
+
+#endif
+
+/*
+ * netdev_WARN() acts like dev_printk(), but with the key difference
+ * of using a WARN/WARN_ON to get the message out, including the
+ * file/line information and a backtrace.
+ */
+#define netdev_WARN(dev, format, args...)			\
+	WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args);
+
+/* netif printk helpers, similar to netdev_printk */
+
+#define netif_printk(priv, type, level, dev, fmt, args...)	\
+do {					  			\
+	if (netif_msg_##type(priv))				\
+		netdev_printk(level, (dev), fmt, ##args);	\
+} while (0)
+
+#define netif_emerg(priv, type, dev, fmt, args...)		\
+	netif_printk(priv, type, KERN_EMERG, dev, fmt, ##args)
+#define netif_alert(priv, type, dev, fmt, args...)		\
+	netif_printk(priv, type, KERN_ALERT, dev, fmt, ##args)
+#define netif_crit(priv, type, dev, fmt, args...)		\
+	netif_printk(priv, type, KERN_CRIT, dev, fmt, ##args)
+#define netif_err(priv, type, dev, fmt, args...)		\
+	netif_printk(priv, type, KERN_ERR, dev, fmt, ##args)
+#define netif_warn(priv, type, dev, fmt, args...)		\
+	netif_printk(priv, type, KERN_WARNING, dev, fmt, ##args)
+#define netif_notice(priv, type, dev, fmt, args...)		\
+	netif_printk(priv, type, KERN_NOTICE, dev, fmt, ##args)
+#define netif_info(priv, type, dev, fmt, args...)		\
+	netif_printk(priv, type, KERN_INFO, (dev), fmt, ##args)
+
+/* mask netif_dbg as RHEL6 backports this */
+#if !defined(netif_dbg)
+
+#if defined(DEBUG)
+#define netif_dbg(priv, type, dev, format, args...)		\
+	netif_printk(priv, type, KERN_DEBUG, dev, format, ##args)
+#elif defined(CONFIG_DYNAMIC_DEBUG)
+#define netif_dbg(priv, type, netdev, format, args...)		\
+do {								\
+	if (netif_msg_##type(priv))				\
+		dynamic_dev_dbg((netdev)->dev.parent,		\
+				"%s: " format,			\
+				netdev_name(netdev), ##args);	\
+} while (0)
+#else
+#define netif_dbg(priv, type, dev, format, args...)			\
+({									\
+	if (0)								\
+		netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
+	0;								\
+})
+#endif
+
+#endif
+
+/* mask netif_vdbg as RHEL6 backports this */
+#if !defined(netif_vdbg)
+
+#if defined(VERBOSE_DEBUG)
+#define netif_vdbg	netdev_dbg
+#else
+#define netif_vdbg(priv, type, dev, format, args...)		\
+({								\
+	if (0)							\
+		netif_printk(KERN_DEBUG, dev, format, ##args);	\
+	0;							\
+})
+#endif
+#endif
+
+#endif /* < 2.6.34 */
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/rcupdate.h b/backport/backport-include/linux/rcupdate.h
index 5770b11..d6d9262 100644
--- a/backport/backport-include/linux/rcupdate.h
+++ b/backport/backport-include/linux/rcupdate.h
@@ -26,4 +26,26 @@
 		p = (typeof(*v) __force __rcu *)(v)
 #endif
 
+#ifndef rcu_dereference_check
+#define rcu_dereference_check(p, c) rcu_dereference(p)
+#endif
+
+#ifndef rcu_dereference_protected
+#define rcu_dereference_protected(p, c) (p)
+#endif
+#ifndef rcu_access_pointer
+#define rcu_access_pointer(p)   ACCESS_ONCE(p)
+#endif
+
+#ifndef rcu_dereference_raw
+#define rcu_dereference_raw(p)	rcu_dereference(p)
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+static inline int rcu_read_lock_held(void)
+{
+	return 1;
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_RCUPDATE_H */
diff --git a/backport/backport-include/linux/rtnetlink.h b/backport/backport-include/linux/rtnetlink.h
index b765cc8..56ba9f6 100644
--- a/backport/backport-include/linux/rtnetlink.h
+++ b/backport/backport-include/linux/rtnetlink.h
@@ -7,4 +7,18 @@
         rcu_dereference_protected(p, lockdep_rtnl_is_held())
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+#ifdef CONFIG_PROVE_LOCKING
+/*
+ * Obviously, this is wrong.  But the base kernel will have rtnl_mutex
+ * declared static, with no way to access it.  I think this is the best
+ * we can do...
+ */
+static inline int lockdep_rtnl_is_held(void)
+{
+        return 1;
+}
+#endif /* #ifdef CONFIG_PROVE_LOCKING */
+#endif /* < 2.6.34 */
+
 #endif /* __BACKPORT_LINUX_RTNETLINK_H */
diff --git a/backport/backport-include/linux/seq_file.h b/backport/backport-include/linux/seq_file.h
index c407161..17f7b3d 100644
--- a/backport/backport-include/linux/seq_file.h
+++ b/backport/backport-include/linux/seq_file.h
@@ -31,4 +31,14 @@ static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
 #endif /* CONFIG_USER_NS */
 #endif /* < 3.7 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+#define seq_hlist_start_head LINUX_BACKPORT(seq_hlist_start_head)
+extern struct hlist_node *seq_hlist_start_head(struct hlist_head *head,
+					       loff_t pos);
+
+#define seq_hlist_next LINUX_BACKPORT(seq_hlist_next)
+extern struct hlist_node *seq_hlist_next(void *v, struct hlist_head *head,
+					 loff_t *ppos);
+#endif
+
 #endif /* __BACKPORT_SEQ_FILE_H */
diff --git a/backport/backport-include/linux/sysfs.h b/backport/backport-include/linux/sysfs.h
new file mode 100644
index 0000000..a2ef73f
--- /dev/null
+++ b/backport/backport-include/linux/sysfs.h
@@ -0,0 +1,34 @@
+#ifndef __BACKPORT_LINUX_SYSFS_H
+#define __BACKPORT_LINUX_SYSFS_H
+#include_next <linux/sysfs.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+#define sysfs_attr_init(attr)				\
+do {							\
+	static struct lock_class_key __key;		\
+							\
+	(attr)->key = &__key;				\
+} while(0)
+#else
+#define sysfs_attr_init(attr) do {} while(0)
+#endif
+
+/* mask sysfs_bin_attr_init as RHEL6 backports this */
+#if !defined(sysfs_bin_attr_init)
+/**
+ *	sysfs_bin_attr_init - initialize a dynamically allocated bin_attribute
+ *	@attr: struct bin_attribute to initialize
+ *
+ *	Initialize a dynamically allocated struct bin_attribute so we
+ *	can make lockdep happy.  This is a new requirement for
+ *	attributes and initially this is only needed when lockdep is
+ *	enabled.  Lockdep gives a nice error when your attribute is
+ *	added to sysfs if you don't have this.
+ */
+#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr)
+#endif
+#endif
+
+#endif /* __BACKPORT_LINUX_SYSFS_H */
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index 3e820f0..d67317f 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -63,4 +63,15 @@ usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+#define usb_alloc_coherent(dev, size, mem_flags, dma) usb_buffer_alloc(dev, size, mem_flags, dma)
+#define usb_free_coherent(dev, size, addr, dma) usb_buffer_free(dev, size, addr, dma)
+
+/* USB autosuspend and autoresume */
+static inline int usb_enable_autosuspend(struct usb_device *udev)
+{ return 0; }
+static inline int usb_disable_autosuspend(struct usb_device *udev)
+{ return 0; }
+#endif
+
 #endif /* __BACKPORT_USB_H */
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
index 4e1141f..6943721 100644
--- a/backport/backport-include/net/sock.h
+++ b/backport/backport-include/net/sock.h
@@ -45,4 +45,11 @@ static inline wait_queue_head_t *sk_sleep(struct sock *sk)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+static inline struct sock *sk_entry(const struct hlist_node *node)
+{
+	return hlist_entry(node, struct sock, sk_node);
+}
+#endif
+
 #endif /* __BACKPORT_NET_SOCK_H */
diff --git a/backport/backport-include/pcmcia/device_id.h b/backport/backport-include/pcmcia/device_id.h
index 0c47a68..908af50 100644
--- a/backport/backport-include/pcmcia/device_id.h
+++ b/backport/backport-include/pcmcia/device_id.h
@@ -13,4 +13,11 @@
 	.prod_id_hash = { 0, 0, (vh3), 0 }, }
 #endif
 
+#ifndef PCMCIA_DEVICE_PROD_ID3
+#define PCMCIA_DEVICE_PROD_ID3(v3, vh3) { \
+	.match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID3, \
+	.prod_id = { NULL, NULL, (v3), NULL },  \
+	.prod_id_hash = { 0, 0, (vh3), 0 }, }
+#endif
+
 #endif /* __BACKPORT_PCMCIA_DEVICE_ID_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 27/42] backports: dissolve compat-2.6.33.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (25 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 26/42] backports: dissolve compat-2.6.34.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 28/42] backports: dissolve compat-2.6.32.h Johannes Berg
                   ` (17 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-2.6.33.h | 190 ------------------------
 backport/backport-include/linux/compiler.h      |   8 +
 backport/backport-include/linux/err.h           |  10 ++
 backport/backport-include/linux/firmware.h      |  21 +++
 backport/backport-include/linux/if.h            |   5 +
 backport/backport-include/linux/input.h         |   4 +
 backport/backport-include/linux/netdevice.h     |   6 +
 backport/backport-include/linux/pci.h           |  20 +++
 backport/backport-include/linux/pm.h            |  13 ++
 backport/backport-include/linux/rculist.h       |   7 +
 backport/backport-include/linux/skbuff.h        |  15 ++
 backport/backport-include/linux/usb.h           |  18 +++
 backport/backport-include/net/sock.h            |   4 +
 backport/backport-include/pcmcia/ds.h           |  19 +++
 14 files changed, 150 insertions(+), 190 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.33.h
 create mode 100644 backport/backport-include/linux/firmware.h

diff --git a/backport/backport-include/linux/compat-2.6.33.h b/backport/backport-include/linux/compat-2.6.33.h
deleted file mode 100644
index b03fe40..0000000
--- a/backport/backport-include/linux/compat-2.6.33.h
+++ /dev/null
@@ -1,190 +0,0 @@
-#ifndef LINUX_26_33_COMPAT_H
-#define LINUX_26_33_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
-
-#include <linux/skbuff.h>
-#include <linux/pci.h>
-#include <linux/usb.h>
-#if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)
-#include <pcmcia/cs_types.h>
-#include <pcmcia/cistpl.h>
-#include <pcmcia/ds.h>
-#endif
-#include <linux/firmware.h>
-#include <linux/input.h>
-
-#define usb_autopm_get_interface_no_resume LINUX_BACKPORT(usb_autopm_get_interface_no_resume)
-#define usb_autopm_put_interface_no_suspend LINUX_BACKPORT(usb_autopm_put_interface_no_suspend)
-#ifdef CONFIG_USB_SUSPEND
-extern void usb_autopm_get_interface_no_resume(struct usb_interface *intf);
-extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf);
-#else
-static inline void usb_autopm_get_interface_no_resume(struct usb_interface *intf)
-{
-	atomic_inc(&intf->pm_usage_cnt);
-}
-static inline void usb_autopm_put_interface_no_suspend(struct usb_interface *intf)
-{
-	atomic_dec(&intf->pm_usage_cnt);
-}
-#endif /* CONFIG_USB_SUSPEND */
-
-#if defined(CPTCFG_BACKPORT_BUILD_FW_LOADER_MODULE)
-#define request_firmware_nowait LINUX_BACKPORT(request_firmware_nowait)
-#define request_firmware LINUX_BACKPORT(request_firmware)
-#define release_firmware LINUX_BACKPORT(release_firmware)
-
-int request_firmware(const struct firmware **fw, const char *name,
-		     struct device *device);
-int request_firmware_nowait(
-	struct module *module, int uevent,
-	const char *name, struct device *device, gfp_t gfp, void *context,
-	void (*cont)(const struct firmware *fw, void *context));
-
-void release_firmware(const struct firmware *fw);
-#endif
-
-/* mask KEY_RFKILL as RHEL6 backports this */
-#if !defined(KEY_RFKILL)
-#define KEY_RFKILL		247	/* Key that controls all radios */
-#endif
-
-/* mask IFF_DONT_BRIDGE as RHEL6 backports this */
-#if !defined(IFF_DONT_BRIDGE)
-#define IFF_DONT_BRIDGE 0x800		/* disallow bridging this ether dev */
-/* source: include/linux/if.h */
-#endif
-
-/* mask NETDEV_POST_INIT as RHEL6 backports this */
-/* this will never happen on older kernels */
-#if !defined(NETDEV_POST_INIT)
-#define NETDEV_POST_INIT 0xffff
-#endif
-
-/* mask netdev_alloc_skb_ip_align as debian squeeze also backports this */
-#define netdev_alloc_skb_ip_align(a, b) compat_netdev_alloc_skb_ip_align(a, b)
-
-static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
-                unsigned int length)
-{
-	struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
-
-	if (NET_IP_ALIGN && skb)
-		skb_reserve(skb, NET_IP_ALIGN);
-	return skb;
-}
-
-#if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)
-
-#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
-
-#define pcmcia_request_window(a, b, c) pcmcia_request_window(&a, b, c)
-
-#define pcmcia_map_mem_page(a, b, c) pcmcia_map_mem_page(b, c)
-
-/* loop over CIS entries */
-#define pcmcia_loop_tuple LINUX_BACKPORT(pcmcia_loop_tuple)
-int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
-		      int (*loop_tuple) (struct pcmcia_device *p_dev,
-					 tuple_t *tuple,
-					 void *priv_data),
-		      void *priv_data);
-
-#endif /* CONFIG_PCMCIA */
-
-/* loop over CIS entries */
-#define pccard_loop_tuple LINUX_BACKPORT(pccard_loop_tuple)
-int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
-		      cisdata_t code, cisparse_t *parse, void *priv_data,
-		      int (*loop_tuple) (tuple_t *tuple,
-					 cisparse_t *parse,
-					 void *priv_data));
-
-#endif /* CONFIG_PCCARD */
-
-/**
- * list_for_each_entry_continue_rcu - continue iteration over list of given type
- * @pos:	the type * to use as a loop cursor.
- * @head:	the head for your list.
- * @member:	the name of the list_struct within the struct.
- *
- * Continue to iterate over list of given type, continuing after
- * the current position.
- */
-#define list_for_each_entry_continue_rcu(pos, head, member) 		\
-	for (pos = list_entry_rcu(pos->member.next, typeof(*pos), member); \
-	     prefetch(pos->member.next), &pos->member != (head);	\
-	     pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
-
-#define sock_recv_ts_and_drops(msg, sk, skb) sock_recv_timestamp(msg, sk, skb)
-
-/* mask pci_pcie_cap as debian squeeze also backports this */
-#define pci_pcie_cap(a) compat_pci_pcie_cap(a)
-
-/**
- * pci_pcie_cap - get the saved PCIe capability offset
- * @dev: PCI device
- *
- * PCIe capability offset is calculated at PCI device initialization
- * time and saved in the data structure. This function returns saved
- * PCIe capability offset. Using this instead of pci_find_capability()
- * reduces unnecessary search in the PCI configuration space. If you
- * need to calculate PCIe capability offset from raw device for some
- * reasons, please use pci_find_capability() instead.
- */
-static inline int pci_pcie_cap(struct pci_dev *dev)
-{
-	return pci_find_capability(dev, PCI_CAP_ID_EXP);
-}
-
-/* mask pci_is_pcie as RHEL6 backports this */
-#define pci_is_pcie(a) compat_pci_is_pcie(a)
-
-/**
- * pci_is_pcie - check if the PCI device is PCI Express capable
- * @dev: PCI device
- *
- * Retrun true if the PCI device is PCI Express capable, false otherwise.
- */
-static inline bool pci_is_pcie(struct pci_dev *dev)
-{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
-	return dev->is_pcie;
-#else
-	return !!pci_pcie_cap(dev);
-#endif
-}
-
-#ifdef __GNUC__
-#define __always_unused			__attribute__((unused))
-#else
-#define __always_unused			/* unimplemented */
-#endif
-
-/* mask IS_ERR_OR_NULL as debian squeeze also backports this */
-#define IS_ERR_OR_NULL(a) compat_IS_ERR_OR_NULL(a)
-
-static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
-{
-	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
-}
-
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32))
-#undef SIMPLE_DEV_PM_OPS
-#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
-const struct dev_pm_ops name = { \
-	.suspend = suspend_fn, \
-	.resume = resume_fn, \
-	.freeze = suspend_fn, \
-	.thaw = resume_fn, \
-	.poweroff = suspend_fn, \
-	.restore = resume_fn, \
-}
-#endif /* (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)) */
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
-
-#endif /* LINUX_26_33_COMPAT_H */
diff --git a/backport/backport-include/linux/compiler.h b/backport/backport-include/linux/compiler.h
index 34c4a4f..0f5dfe4 100644
--- a/backport/backport-include/linux/compiler.h
+++ b/backport/backport-include/linux/compiler.h
@@ -6,4 +6,12 @@
 #define __rcu
 #endif
 
+#ifndef __always_unused
+#ifdef __GNUC__
+#define __always_unused			__attribute__((unused))
+#else
+#define __always_unused			/* unimplemented */
+#endif
+#endif
+
 #endif /* __BACKPORT_LINUX_COMPILER_H */
diff --git a/backport/backport-include/linux/err.h b/backport/backport-include/linux/err.h
index cf63ea0..f62e3bf 100644
--- a/backport/backport-include/linux/err.h
+++ b/backport/backport-include/linux/err.h
@@ -13,4 +13,14 @@ static inline int __must_check PTR_RET(const void *ptr)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+/* mask IS_ERR_OR_NULL as debian squeeze also backports this */
+#define IS_ERR_OR_NULL LINUX_BACKPORT(IS_ERR_OR_NULL)
+
+static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
+{
+	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_ERR_H */
diff --git a/backport/backport-include/linux/firmware.h b/backport/backport-include/linux/firmware.h
new file mode 100644
index 0000000..9271f96
--- /dev/null
+++ b/backport/backport-include/linux/firmware.h
@@ -0,0 +1,21 @@
+#ifndef __BACKPORT_LINUX_FIRMWARE_H
+#define __BACKPORT_LINUX_FIRMWARE_H
+#include_next <linux/firmware.h>
+#include <linux/version.h>
+
+#if defined(CPTCFG_BACKPORT_BUILD_FW_LOADER_MODULE)
+#define request_firmware_nowait LINUX_BACKPORT(request_firmware_nowait)
+#define request_firmware LINUX_BACKPORT(request_firmware)
+#define release_firmware LINUX_BACKPORT(release_firmware)
+
+int request_firmware(const struct firmware **fw, const char *name,
+		     struct device *device);
+int request_firmware_nowait(
+	struct module *module, int uevent,
+	const char *name, struct device *device, gfp_t gfp, void *context,
+	void (*cont)(const struct firmware *fw, void *context));
+
+void release_firmware(const struct firmware *fw);
+#endif
+
+#endif /* __BACKPORT_LINUX_FIRMWARE_H */
diff --git a/backport/backport-include/linux/if.h b/backport/backport-include/linux/if.h
index 53f615c..7926082 100644
--- a/backport/backport-include/linux/if.h
+++ b/backport/backport-include/linux/if.h
@@ -3,6 +3,11 @@
 #include_next <linux/if.h>
 #include <linux/version.h>
 
+/* mask IFF_DONT_BRIDGE as RHEL6 backports this */
+#if !defined(IFF_DONT_BRIDGE)
+#define IFF_DONT_BRIDGE 0x800		/* disallow bridging this ether dev */
+#endif
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
 #define br_port_exists(dev)	(dev->br_port)
 #else
diff --git a/backport/backport-include/linux/input.h b/backport/backport-include/linux/input.h
index 0d58f9b..fa95263 100644
--- a/backport/backport-include/linux/input.h
+++ b/backport/backport-include/linux/input.h
@@ -10,4 +10,8 @@
 #define KEY_WPS_BUTTON		0x211
 #endif
 
+#ifndef KEY_RFKILL
+#define KEY_RFKILL		247
+#endif
+
 #endif /* __BACKPORT_INPUT_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index b18d9c7..b4bbf16 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -277,4 +277,10 @@ do {								\
 
 #endif /* < 2.6.34 */
 
+/* mask NETDEV_POST_INIT as RHEL6 backports this */
+/* this will never happen on older kernels */
+#ifndef NETDEV_POST_INIT
+#define NETDEV_POST_INIT 0xffff
+#endif
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index eb985f1..e85db3a 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -78,4 +78,24 @@ static inline void __iomem *pci_platform_rom(struct pci_dev *pdev, size_t *size)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+/* mask pci_pcie_cap as debian squeeze also backports this */
+#define pci_pcie_cap LINUX_BACKPORT(pci_pcie_cap)
+static inline int pci_pcie_cap(struct pci_dev *dev)
+{
+	return pci_find_capability(dev, PCI_CAP_ID_EXP);
+}
+
+/* mask pci_is_pcie as RHEL6 backports this */
+#define pci_is_pcie LINUX_BACKPORT(pci_is_pcie)
+static inline bool pci_is_pcie(struct pci_dev *dev)
+{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
+	return dev->is_pcie;
+#else
+	return !!pci_pcie_cap(dev);
+#endif
+}
+#endif /* < 2.6.33 */
+
 #endif /* _BACKPORT_LINUX_PCI_H */
diff --git a/backport/backport-include/linux/pm.h b/backport/backport-include/linux/pm.h
index 09ab926..b637763 100644
--- a/backport/backport-include/linux/pm.h
+++ b/backport/backport-include/linux/pm.h
@@ -10,4 +10,17 @@
 #define PMSG_IS_AUTO(msg)	(((msg).event & PM_EVENT_AUTO) != 0)
 #endif
 
+#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
+#undef SIMPLE_DEV_PM_OPS
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
+const struct dev_pm_ops name = { \
+	.suspend = suspend_fn, \
+	.resume = resume_fn, \
+	.freeze = suspend_fn, \
+	.thaw = resume_fn, \
+	.poweroff = suspend_fn, \
+	.restore = resume_fn, \
+}
+#endif /* 2.6.32 */
+
 #endif /* __BACKPORT_PM_H */
diff --git a/backport/backport-include/linux/rculist.h b/backport/backport-include/linux/rculist.h
index 38afa4b..bb9f367 100644
--- a/backport/backport-include/linux/rculist.h
+++ b/backport/backport-include/linux/rculist.h
@@ -39,4 +39,11 @@
 
 #endif /* < 2.6.37 */
 
+#ifndef list_for_each_entry_continue_rcu
+#define list_for_each_entry_continue_rcu(pos, head, member) 		\
+	for (pos = list_entry_rcu(pos->member.next, typeof(*pos), member); \
+	     prefetch(pos->member.next), &pos->member != (head);	\
+	     pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
+#endif
+
 #endif /* __BACKPORT_RCULIST_H */
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 5107f65..e7f667e 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -102,4 +102,19 @@ static inline void skb_tx_timestamp(struct sk_buff *skb)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+/* mask netdev_alloc_skb_ip_align as debian squeeze also backports this */
+#define netdev_alloc_skb_ip_align LINUX_BACKPORT(netdev_alloc_skb_ip_align)
+
+static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
+                unsigned int length)
+{
+	struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
+
+	if (NET_IP_ALIGN && skb)
+		skb_reserve(skb, NET_IP_ALIGN);
+	return skb;
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index d67317f..79ac140 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -74,4 +74,22 @@ static inline int usb_disable_autosuspend(struct usb_device *udev)
 { return 0; }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+#define usb_autopm_get_interface_no_resume LINUX_BACKPORT(usb_autopm_get_interface_no_resume)
+#define usb_autopm_put_interface_no_suspend LINUX_BACKPORT(usb_autopm_put_interface_no_suspend)
+#ifdef CONFIG_USB_SUSPEND
+extern void usb_autopm_get_interface_no_resume(struct usb_interface *intf);
+extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf);
+#else
+static inline void usb_autopm_get_interface_no_resume(struct usb_interface *intf)
+{
+	atomic_inc(&intf->pm_usage_cnt);
+}
+static inline void usb_autopm_put_interface_no_suspend(struct usb_interface *intf)
+{
+	atomic_dec(&intf->pm_usage_cnt);
+}
+#endif /* CONFIG_USB_SUSPEND */
+#endif /* < 2.6.33 */
+
 #endif /* __BACKPORT_USB_H */
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
index 6943721..93dc6a8 100644
--- a/backport/backport-include/net/sock.h
+++ b/backport/backport-include/net/sock.h
@@ -52,4 +52,8 @@ static inline struct sock *sk_entry(const struct hlist_node *node)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+#define sock_recv_ts_and_drops(msg, sk, skb) sock_recv_timestamp(msg, sk, skb)
+#endif
+
 #endif /* __BACKPORT_NET_SOCK_H */
diff --git a/backport/backport-include/pcmcia/ds.h b/backport/backport-include/pcmcia/ds.h
index 7c49500..5cc2e60 100644
--- a/backport/backport-include/pcmcia/ds.h
+++ b/backport/backport-include/pcmcia/ds.h
@@ -47,4 +47,23 @@ static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t wh
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+#define pcmcia_request_window(a, b, c) pcmcia_request_window(&a, b, c)
+#define pcmcia_map_mem_page(a, b, c) pcmcia_map_mem_page(b, c)
+
+#define pcmcia_loop_tuple LINUX_BACKPORT(pcmcia_loop_tuple)
+int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
+		      int (*loop_tuple) (struct pcmcia_device *p_dev,
+					 tuple_t *tuple,
+					 void *priv_data),
+		      void *priv_data);
+
+#define pccard_loop_tuple LINUX_BACKPORT(pccard_loop_tuple)
+int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
+		      cisdata_t code, cisparse_t *parse, void *priv_data,
+		      int (*loop_tuple) (tuple_t *tuple,
+					 cisparse_t *parse,
+					 void *priv_data));
+#endif /* < 2.6.33 */
+
 #endif /* __BACKPORT_PCMCIA_DS_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 28/42] backports: dissolve compat-2.6.32.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (26 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 27/42] backports: dissolve compat-2.6.33.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 29/42] backports: dissolve compat-2.6.31.h Johannes Berg
                   ` (16 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-2.6.32.h    | 198 ---------------------
 backport/backport-include/linux/lockdep.h          |   4 +
 backport/backport-include/linux/mmc/sdio_func.h    |   4 +
 backport/backport-include/linux/netdevice.h        |   8 +
 backport/backport-include/linux/pm.h               |  32 ++++
 backport/backport-include/linux/pm_runtime.h       |  51 ++++++
 backport/backport-include/linux/time.h             |  27 +++
 backport/backport-include/linux/workqueue.h        |  20 +++
 backport/backport-include/net/genetlink.h          |  16 ++
 backport/backport-include/net/iw_handler.h         |  10 ++
 backport/backport-include/net/mac80211.h           |   8 +
 backport/backport-include/net/sch_generic.h        |  11 ++
 .../network/15-symbol-export-conflicts/INFO        |   3 -
 .../net_mac80211_rx.patch                          |  15 --
 14 files changed, 191 insertions(+), 216 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.32.h
 create mode 100644 backport/backport-include/linux/time.h
 create mode 100644 backport/backport-include/net/iw_handler.h
 create mode 100644 backport/backport-include/net/mac80211.h
 delete mode 100644 patches/collateral-evolutions/network/15-symbol-export-conflicts/INFO
 delete mode 100644 patches/collateral-evolutions/network/15-symbol-export-conflicts/net_mac80211_rx.patch

diff --git a/backport/backport-include/linux/compat-2.6.32.h b/backport/backport-include/linux/compat-2.6.32.h
deleted file mode 100644
index d5b5df8..0000000
--- a/backport/backport-include/linux/compat-2.6.32.h
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifndef LINUX_26_32_COMPAT_H
-#define LINUX_26_32_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32))
-
-#include <linux/netdevice.h>
-#include <linux/compat.h>
-#include <net/iw_handler.h>
-#include <linux/workqueue.h>
-#include <net/genetlink.h>
-#include <net/sch_generic.h>
-
-#define TCQ_F_CAN_BYPASS        4
-
-static inline int qdisc_qlen(const struct Qdisc *q)
-{
-	return q->q.qlen;
-}
-
-#define SDIO_VENDOR_ID_INTEL			0x0089
-#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX	0x1402
-#define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI	0x1403
-#define SDIO_DEVICE_ID_INTEL_IWMC3200TOP	0x1404
-#define SDIO_DEVICE_ID_INTEL_IWMC3200GPS	0x1405
-#define SDIO_DEVICE_ID_INTEL_IWMC3200BT		0x1406
-
-/*
- * Backports 5e928f77a09a07f9dd595bb8a489965d69a83458
- * run-time power management cannot really be backported
- * given that the implementation added bus specific
- * callbacks that we won't have on older kernels. If
- * you really want run-time power management or good
- * power management upgrade your kernel. We'll just
- * compile this out as if run-time power management was
- * disabled just as the kernel disables run-time power management
- * when CONFIG_PM_RUNTIME is disabled.
- */
-static inline void pm_runtime_init(struct device *dev) {}
-static inline void pm_runtime_remove(struct device *dev) {}
-static inline int pm_runtime_get(struct device *dev)
-{
-	return 0;
-}
-
-static inline int pm_runtime_get_sync(struct device *dev)
-{
-	return 0;
-}
-
-static inline int pm_runtime_put(struct device *dev)
-{
-	return 0;
-}
-
-static inline int pm_runtime_put_sync(struct device *dev)
-{
-	return 0;
-}
-
-static inline int pm_runtime_set_active(struct device *dev)
-{
-	return 0;
-}
-
-static inline void pm_runtime_set_suspended(struct device *dev)
-{
-}
-
-static inline void pm_runtime_disable(struct device *dev)
-{
-}
-
-static inline void pm_runtime_put_noidle(struct device *dev) {}
-static inline void pm_runtime_get_noresume(struct device *dev) {}
-
-static inline void flush_delayed_work(struct delayed_work *dwork)
-{
-	if (del_timer_sync(&dwork->timer)) {
-		/*
-		 * This is what would happen on 2.6.32 but since we don't have
-		 * access to the singlethread_cpu we can't really backport this,
-		 * so avoid really *flush*ing the work... Oh well. Any better ideas?
-
-		struct cpu_workqueue_struct *cwq;
-		cwq = wq_per_cpu(keventd_wq, get_cpu());
-		__queue_work(cwq, &dwork->work);
-		put_cpu();
-
-		*/
-	}
-	flush_work(&dwork->work);
-}
-
-/*
- * struct genl_multicast_group was made netns aware through
- * patch "genetlink: make netns aware" by johannes, we just
- * force this to always use the default init_net
- */
-#define genl_info_net(x) &init_net
-/* Just use init_net for older kernels */
-#define get_net_ns_by_pid(x) &init_net
-
-/* net namespace is lost */
-#define genlmsg_multicast_netns(a, b, c, d, e)	genlmsg_multicast(b, c, d, e)
-#define genlmsg_multicast_allns(a, b, c, d)	genlmsg_multicast(a, b, c, d)
-#define genlmsg_unicast(net, skb, pid)	genlmsg_unicast(skb, pid)
-
-#define dev_change_net_namespace(a, b, c) (-EOPNOTSUPP)
-
-#define SET_NETDEV_DEVTYPE(netdev, type)
-
-#ifdef __KERNEL__
-/* Driver transmit return codes */
-enum netdev_tx {
-	BACKPORT_NETDEV_TX_OK = NETDEV_TX_OK,       /* driver took care of packet */
-	BACKPORT_NETDEV_TX_BUSY = NETDEV_TX_BUSY,         /* driver tx path was busy*/
-	BACKPORT_NETDEV_TX_LOCKED = NETDEV_TX_LOCKED,  /* driver tx lock was already taken */
-};
-typedef enum netdev_tx netdev_tx_t;
-#endif /* __KERNEL__ */
-
-/*
- * dev_pm_ops is only available on kernels >= 2.6.29, for
- * older kernels we rely on reverting the work to old
- * power management style stuff. On 2.6.29 the pci calls
- * weren't included yet though, so include them here.
- */
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,29))
-#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn)		\
-struct dev_pm_ops name = {					\
-	.suspend = suspend_fn ## _compat,			\
-	.resume = resume_fn ## _compat,				\
-	.freeze = suspend_fn ## _compat,			\
-	.thaw = resume_fn ## _compat,				\
-	.poweroff = suspend_fn ## _compat,			\
-	.restore = resume_fn ## _compat,			\
-}
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30))
-/*
- * Use this if you want to use the same suspend and resume callbacks for suspend
- * to RAM and hibernation.
- */
-#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
-struct dev_pm_ops name = { \
-	.suspend = suspend_fn, \
-	.resume = resume_fn, \
-	.freeze = suspend_fn, \
-	.thaw = resume_fn, \
-	.poweroff = suspend_fn, \
-	.restore = resume_fn, \
-}
-#else
-#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn)
-#endif /* >= 2.6.29 */
-
-#define wireless_send_event(a, b, c, d) wireless_send_event(a, b, c, (char * ) d)
-
-/* The export symbol in changed in compat/patches/15-symbol-export-conflicts.patch */
-#define ieee80211_rx(hw, skb) mac80211_ieee80211_rx(hw, skb)
-
-#define dev_to_sdio_func(d)	container_of(d, struct sdio_func, dev)
-
-#define lockdep_assert_held(l)			do { } while (0)
-
-/*
- * Similar to the struct tm in userspace <time.h>, but it needs to be here so
- * that the kernel source is self contained.
- */
-struct tm {
-	/*
-	 * the number of seconds after the minute, normally in the range
-	 * 0 to 59, but can be up to 60 to allow for leap seconds
-	 */
-	int tm_sec;
-	/* the number of minutes after the hour, in the range 0 to 59*/
-	int tm_min;
-	/* the number of hours past midnight, in the range 0 to 23 */
-	int tm_hour;
-	/* the day of the month, in the range 1 to 31 */
-	int tm_mday;
-	/* the number of months since January, in the range 0 to 11 */
-	int tm_mon;
-	/* the number of years since 1900 */
-	long tm_year;
-	/* the number of days since Sunday, in the range 0 to 6 */
-	int tm_wday;
-	/* the number of days since January 1, in the range 0 to 365 */
-	int tm_yday;
-};
-
-#define time_to_tm LINUX_BACKPORT(time_to_tm)
-void time_to_tm(time_t totalsecs, int offset, struct tm *result);
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) */
-
-#endif /* LINUX_26_32_COMPAT_H */
diff --git a/backport/backport-include/linux/lockdep.h b/backport/backport-include/linux/lockdep.h
index 25706b9..f7f7fb8 100644
--- a/backport/backport-include/linux/lockdep.h
+++ b/backport/backport-include/linux/lockdep.h
@@ -24,4 +24,8 @@
 
 #endif /* < 2.6.38 */
 
+#ifndef lockdep_assert_held
+#define lockdep_assert_held(l)			do { } while (0)
+#endif
+
 #endif /* __BACKPORT_LINUX_LOCKDEP_H */
diff --git a/backport/backport-include/linux/mmc/sdio_func.h b/backport/backport-include/linux/mmc/sdio_func.h
index 62f89a5..b596004 100644
--- a/backport/backport-include/linux/mmc/sdio_func.h
+++ b/backport/backport-include/linux/mmc/sdio_func.h
@@ -27,4 +27,8 @@ extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
 extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
 #endif
 
+#ifndef dev_to_sdio_func
+#define dev_to_sdio_func(d)	container_of(d, struct sdio_func, dev)
+#endif
+
 #endif /* __BACKPORT_MMC_SDIO_FUNC_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index b4bbf16..ee4f410 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -7,6 +7,14 @@
 /* older kernels don't include this here, we need it */
 #include <linux/ethtool.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+#define dev_change_net_namespace(a, b, c) (-EOPNOTSUPP)
+
+#define SET_NETDEV_DEVTYPE(netdev, type)
+
+typedef int netdev_tx_t;
+#endif
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
 #define netdev_set_default_ethtool_ops LINUX_BACKPORT(netdev_set_default_ethtool_ops)
 extern void netdev_set_default_ethtool_ops(struct net_device *dev,
diff --git a/backport/backport-include/linux/pm.h b/backport/backport-include/linux/pm.h
index b637763..4e30652 100644
--- a/backport/backport-include/linux/pm.h
+++ b/backport/backport-include/linux/pm.h
@@ -23,4 +23,36 @@ const struct dev_pm_ops name = { \
 }
 #endif /* 2.6.32 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+/*
+ * dev_pm_ops is only available on kernels >= 2.6.29, for
+ * older kernels we rely on reverting the work to old
+ * power management style stuff. On 2.6.29 the pci calls
+ * weren't included yet though, so include them here.
+ */
+#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,29)
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn)		\
+struct dev_pm_ops name = {					\
+	.suspend = suspend_fn ## _compat,			\
+	.resume = resume_fn ## _compat,				\
+	.freeze = suspend_fn ## _compat,			\
+	.thaw = resume_fn ## _compat,				\
+	.poweroff = suspend_fn ## _compat,			\
+	.restore = resume_fn ## _compat,			\
+}
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
+struct dev_pm_ops name = { \
+	.suspend = suspend_fn, \
+	.resume = resume_fn, \
+	.freeze = suspend_fn, \
+	.thaw = resume_fn, \
+	.poweroff = suspend_fn, \
+	.restore = resume_fn, \
+}
+#else
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn)
+#endif /* >= 2.6.29 */
+#endif /* < 2.6.32 */
+
 #endif /* __BACKPORT_PM_H */
diff --git a/backport/backport-include/linux/pm_runtime.h b/backport/backport-include/linux/pm_runtime.h
index eec965b..31cfde9 100644
--- a/backport/backport-include/linux/pm_runtime.h
+++ b/backport/backport-include/linux/pm_runtime.h
@@ -11,4 +11,55 @@ static inline void pm_runtime_enable(struct device *dev) {}
 
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+/*
+ * Backports 5e928f77a09a07f9dd595bb8a489965d69a83458
+ * run-time power management cannot really be backported
+ * given that the implementation added bus specific
+ * callbacks that we won't have on older kernels. If
+ * you really want run-time power management or good
+ * power management upgrade your kernel. We'll just
+ * compile this out as if run-time power management was
+ * disabled just as the kernel disables run-time power management
+ * when CONFIG_PM_RUNTIME is disabled.
+ */
+static inline void pm_runtime_init(struct device *dev) {}
+static inline void pm_runtime_remove(struct device *dev) {}
+static inline int pm_runtime_get(struct device *dev)
+{
+	return 0;
+}
+
+static inline int pm_runtime_get_sync(struct device *dev)
+{
+	return 0;
+}
+
+static inline int pm_runtime_put(struct device *dev)
+{
+	return 0;
+}
+
+static inline int pm_runtime_put_sync(struct device *dev)
+{
+	return 0;
+}
+
+static inline int pm_runtime_set_active(struct device *dev)
+{
+	return 0;
+}
+
+static inline void pm_runtime_set_suspended(struct device *dev)
+{
+}
+
+static inline void pm_runtime_disable(struct device *dev)
+{
+}
+
+static inline void pm_runtime_put_noidle(struct device *dev) {}
+static inline void pm_runtime_get_noresume(struct device *dev) {}
+#endif
+
 #endif
diff --git a/backport/backport-include/linux/time.h b/backport/backport-include/linux/time.h
new file mode 100644
index 0000000..0bc12de
--- /dev/null
+++ b/backport/backport-include/linux/time.h
@@ -0,0 +1,27 @@
+#ifndef __BACKPORT_LINUX_TIME_H
+#define __BACKPORT_LINUX_TIME_H
+#include_next <linux/time.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+/*
+ * Similar to the struct tm in userspace <time.h>, but it needs to be here so
+ * that the kernel source is self contained.
+ */
+struct tm {
+	int tm_sec;
+	int tm_min;
+	int tm_hour;
+	int tm_mday;
+	int tm_mon;
+	long tm_year;
+	int tm_wday;
+	int tm_yday;
+};
+
+#define time_to_tm LINUX_BACKPORT(time_to_tm)
+void time_to_tm(time_t totalsecs, int offset, struct tm *result);
+
+#endif /* < 2.6.32 */
+
+#endif /* __BACKPORT_LINUX_TIME_H */
diff --git a/backport/backport-include/linux/workqueue.h b/backport/backport-include/linux/workqueue.h
index 79c5cf6..0caaf05 100644
--- a/backport/backport-include/linux/workqueue.h
+++ b/backport/backport-include/linux/workqueue.h
@@ -67,4 +67,24 @@ static inline void backport_system_workqueue_destroy(void)
 }
 #endif /* < 2.6.36 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+static inline void flush_delayed_work(struct delayed_work *dwork)
+{
+	if (del_timer_sync(&dwork->timer)) {
+		/*
+		 * This is what would happen on 2.6.32 but since we don't have
+		 * access to the singlethread_cpu we can't really backport this,
+		 * so avoid really *flush*ing the work... Oh well. Any better ideas?
+
+		struct cpu_workqueue_struct *cwq;
+		cwq = wq_per_cpu(keventd_wq, get_cpu());
+		__queue_work(cwq, &dwork->work);
+		put_cpu();
+
+		*/
+	}
+	flush_work(&dwork->work);
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_WORKQUEUE_H */
diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index 0e10936..4458a10 100644
--- a/backport/backport-include/net/genetlink.h
+++ b/backport/backport-include/net/genetlink.h
@@ -82,4 +82,20 @@ int genl_unregister_family(struct genl_family *family);
 #define genl_unregister_mc_group(_fam, _grp) genl_unregister_mc_group(&(_fam)->family, _grp)
 #endif /* < 2.6.37 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+/*
+ * struct genl_multicast_group was made netns aware through
+ * patch "genetlink: make netns aware" by johannes, we just
+ * force this to always use the default init_net
+ */
+#define genl_info_net(x) &init_net
+/* Just use init_net for older kernels */
+#define get_net_ns_by_pid(x) &init_net
+
+/* net namespace is lost */
+#define genlmsg_multicast_netns(a, b, c, d, e)	genlmsg_multicast(b, c, d, e)
+#define genlmsg_multicast_allns(a, b, c, d)	genlmsg_multicast(a, b, c, d)
+#define genlmsg_unicast(net, skb, pid)	genlmsg_unicast(skb, pid)
+#endif
+
 #endif /* __BACKPORT_NET_GENETLINK_H */
diff --git a/backport/backport-include/net/iw_handler.h b/backport/backport-include/net/iw_handler.h
new file mode 100644
index 0000000..6776720
--- /dev/null
+++ b/backport/backport-include/net/iw_handler.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_NET_IW_HANDLER_H
+#define __BACKPORT_NET_IW_HANDLER_H
+#include_next <net/iw_handler.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+#define wireless_send_event(a, b, c, d) wireless_send_event(a, b, c, (char * ) d)
+#endif
+
+#endif /* __BACKPORT_NET_IW_HANDLER_H */
diff --git a/backport/backport-include/net/mac80211.h b/backport/backport-include/net/mac80211.h
new file mode 100644
index 0000000..c31b462
--- /dev/null
+++ b/backport/backport-include/net/mac80211.h
@@ -0,0 +1,8 @@
+#ifndef __BACKPORT_NET_MAC80211_H
+#define __BACKPORT_NET_MAC80211_H
+
+/* on some kernels, libipw also uses this, so override */
+#define ieee80211_rx mac80211_ieee80211_rx
+#include_next <net/mac80211.h>
+
+#endif /* __BACKPORT_NET_MAC80211_H */
diff --git a/backport/backport-include/net/sch_generic.h b/backport/backport-include/net/sch_generic.h
index 63ac16e..196d098 100644
--- a/backport/backport-include/net/sch_generic.h
+++ b/backport/backport-include/net/sch_generic.h
@@ -80,4 +80,15 @@ static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
 #endif /* >= 2.6.27 */
 #endif /* < 2.6.35 */
 
+#ifndef TCQ_F_CAN_BYPASS
+#define TCQ_F_CAN_BYPASS        4
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+static inline int qdisc_qlen(const struct Qdisc *q)
+{
+	return q->q.qlen;
+}
+#endif
+
 #endif /* __BACKPORT_NET_SCH_GENERIC_H */
diff --git a/patches/collateral-evolutions/network/15-symbol-export-conflicts/INFO b/patches/collateral-evolutions/network/15-symbol-export-conflicts/INFO
deleted file mode 100644
index 4035615..0000000
--- a/patches/collateral-evolutions/network/15-symbol-export-conflicts/INFO
+++ /dev/null
@@ -1,3 +0,0 @@
-In kernel < 2.6.32 libipw also exports ieee80211_rx.
-To avoid conflicts with the other export we rename our.
-
diff --git a/patches/collateral-evolutions/network/15-symbol-export-conflicts/net_mac80211_rx.patch b/patches/collateral-evolutions/network/15-symbol-export-conflicts/net_mac80211_rx.patch
deleted file mode 100644
index e8f890d..0000000
--- a/patches/collateral-evolutions/network/15-symbol-export-conflicts/net_mac80211_rx.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -3317,7 +3317,12 @@ void ieee80211_rx(struct ieee80211_hw *h
-  drop:
- 	kfree_skb(skb);
- }
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
- EXPORT_SYMBOL(ieee80211_rx);
-+#else
-+EXPORT_SYMBOL(mac80211_ieee80211_rx);
-+#endif
-+
- 
- /* This is a version of the rx handler that can be called from hard irq
-  * context. Post the skb on the queue and schedule the tasklet */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 29/42] backports: dissolve compat-2.6.31.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (27 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 28/42] backports: dissolve compat-2.6.32.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 30/42] backports: dissolve compat-2.6.30.h Johannes Berg
                   ` (15 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/asm/atomic.h          |  17 ++
 backport/backport-include/asm/errno.h           |  23 ++
 backport/backport-include/linux/compat-2.6.31.h | 273 ------------------------
 backport/backport-include/linux/ethtool.h       |  14 ++
 backport/backport-include/linux/interrupt.h     |  83 +++++++
 backport/backport-include/linux/kmemleak.h      |  21 +-
 backport/backport-include/linux/mdio.h          |  17 ++
 backport/backport-include/linux/mmc/sdio_ids.h  |   4 +
 backport/backport-include/linux/netdevice.h     |   4 +
 backport/backport-include/linux/rculist.h       |   5 +
 backport/backport-include/linux/rfkill.h        |  16 ++
 backport/backport-include/linux/skbuff.h        |   5 +
 backport/backport-include/linux/usb.h           |   5 +
 backport/backport-include/net/dst.h             |  35 +++
 backport/backport-include/net/sock.h            |  17 ++
 15 files changed, 265 insertions(+), 274 deletions(-)
 create mode 100644 backport/backport-include/asm/errno.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.31.h
 create mode 100644 backport/backport-include/linux/mdio.h
 create mode 100644 backport/backport-include/net/dst.h

diff --git a/backport/backport-include/asm/atomic.h b/backport/backport-include/asm/atomic.h
index f8c9fa7..cabdcfd 100644
--- a/backport/backport-include/asm/atomic.h
+++ b/backport/backport-include/asm/atomic.h
@@ -17,4 +17,21 @@
 #endif
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+#ifndef CONFIG_64BIT
+
+typedef struct {
+	long long counter;
+} atomic64_t;
+
+#define atomic64_read LINUX_BACKPORT(atomic64_read)
+extern long long atomic64_read(const atomic64_t *v);
+#define atomic64_add_return LINUX_BACKPORT(atomic64_add_return)
+extern long long atomic64_add_return(long long a, atomic64_t *v);
+
+#define atomic64_inc_return(v)          atomic64_add_return(1LL, (v))
+
+#endif
+#endif
+
 #endif /* __BACKPORT_ASM_ATOMIC_H */
diff --git a/backport/backport-include/asm/errno.h b/backport/backport-include/asm/errno.h
new file mode 100644
index 0000000..0a730b7
--- /dev/null
+++ b/backport/backport-include/asm/errno.h
@@ -0,0 +1,23 @@
+#ifndef __BACKPORT_ASM_ERRNO_H
+#define __BACKPORT_ASM_ERRNO_H
+#include_next <asm/errno.h>
+
+#ifndef ERFKILL
+#if !defined(CONFIG_ALPHA) && !defined(CONFIG_MIPS) && !defined(CONFIG_PARISC) && !defined(CONFIG_SPARC)
+#define ERFKILL		132	/* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_ALPHA
+#define ERFKILL		138	/* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_MIPS
+#define ERFKILL		167	/* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_PARISC
+#define ERFKILL		256	/* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_SPARC
+#define ERFKILL		134	/* Operation not possible due to RF-kill */
+#endif
+#endif
+
+#endif /* __BACKPORT_ASM_ERRNO_H */
diff --git a/backport/backport-include/linux/compat-2.6.31.h b/backport/backport-include/linux/compat-2.6.31.h
deleted file mode 100644
index 096c131..0000000
--- a/backport/backport-include/linux/compat-2.6.31.h
+++ /dev/null
@@ -1,273 +0,0 @@
-#ifndef LINUX_26_31_COMPAT_H
-#define LINUX_26_31_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31))
-
-#include <linux/skbuff.h>
-#include <linux/workqueue.h>
-#include <linux/interrupt.h>
-#include <net/dst.h>
-#include <net/genetlink.h>
-#include <linux/ethtool.h>
-#include <net/sock.h>
-
-#define SUPPORTED_Backplane            (1 << 16)
-#define SUPPORTED_1000baseKX_Full      (1 << 17)
-#define SUPPORTED_10000baseKX4_Full    (1 << 18)
-#define SUPPORTED_10000baseKR_Full     (1 << 19)
-#define SUPPORTED_10000baseR_FEC       (1 << 20)
-
-#define ADVERTISED_Backplane           (1 << 16)
-#define ADVERTISED_1000baseKX_Full     (1 << 17)
-#define ADVERTISED_10000baseKX4_Full   (1 << 18)
-#define ADVERTISED_10000baseKR_Full    (1 << 19)
-#define ADVERTISED_10000baseR_FEC      (1 << 20)
-
-#define rfkill_get_led_trigger_name LINUX_BACKPORT(rfkill_get_led_trigger_name)
-#define rfkill_set_led_trigger_name LINUX_BACKPORT(rfkill_set_led_trigger_name)
-#define rfkill_set_hw_state LINUX_BACKPORT(rfkill_set_hw_state)
-#define rfkill_set_sw_state LINUX_BACKPORT(rfkill_set_sw_state)
-#define rfkill_init_sw_state LINUX_BACKPORT(rfkill_init_sw_state)
-#define rfkill_set_states LINUX_BACKPORT(rfkill_set_states)
-#define rfkill_pause_polling LINUX_BACKPORT(rfkill_pause_polling)
-#define rfkill_resume_polling LINUX_BACKPORT(rfkill_resume_polling)
-#define rfkill_blocked LINUX_BACKPORT(rfkill_blocked)
-#define rfkill_alloc LINUX_BACKPORT(rfkill_alloc)
-#define rfkill_register LINUX_BACKPORT(rfkill_register)
-#define rfkill_unregister LINUX_BACKPORT(rfkill_unregister)
-#define rfkill_destroy LINUX_BACKPORT(rfkill_destroy)
-
-#ifndef ERFKILL
-#if !defined(CONFIG_ALPHA) && !defined(CONFIG_MIPS) && !defined(CONFIG_PARISC) && !defined(CONFIG_SPARC)
-#define ERFKILL		132	/* Operation not possible due to RF-kill */
-#endif
-#ifdef CONFIG_ALPHA
-#define ERFKILL		138	/* Operation not possible due to RF-kill */
-#endif
-#ifdef CONFIG_MIPS
-#define ERFKILL		167	/* Operation not possible due to RF-kill */
-#endif
-#ifdef CONFIG_PARISC
-#define ERFKILL		256	/* Operation not possible due to RF-kill */
-#endif
-#ifdef CONFIG_SPARC
-#define ERFKILL		134	/* Operation not possible due to RF-kill */
-#endif
-#endif
-
-#define mdio45_probe LINUX_BACKPORT(mdio45_probe)
-#define mdio_set_flag LINUX_BACKPORT(mdio_set_flag)
-#define mdio45_links_ok LINUX_BACKPORT(mdio45_links_ok)
-#define mdio45_nway_restart LINUX_BACKPORT(mdio45_nway_restart)
-
-#define mdio45_ethtool_gset_npage LINUX_BACKPORT(mdio45_ethtool_gset_npage)
-#define mdio45_ethtool_spauseparam_an LINUX_BACKPORT(mdio45_ethtool_spauseparam_an)
-#define mdio_mii_ioctl LINUX_BACKPORT(mdio_mii_ioctl)
-
-#ifndef NETDEV_PRE_UP
-#define NETDEV_PRE_UP		0x000D
-#endif
-
-#ifndef SDIO_DEVICE_ID_MARVELL_8688WLAN
-#define SDIO_DEVICE_ID_MARVELL_8688WLAN		0x9104
-#endif
-
-struct compat_threaded_irq {
-	unsigned int irq;
-	irq_handler_t handler;
-	irq_handler_t thread_fn;
-	void *dev_id;
-	char wq_name[64];
-	struct workqueue_struct *wq;
-	struct work_struct work;
-};
-
-/*
- * kmemleak was introduced on 2.6.31, since older kernels do not have
- * we simply ignore its tuning.
- */
-static inline void kmemleak_ignore(const void *ptr)
-{
-	return;
-}
-
-static inline void kmemleak_not_leak(const void *ptr)
-{
-	return;
-}
-
-static inline void kmemleak_no_scan(const void *ptr)
-{
-	return;
-}
-
-/*
- * Added via adf30907d63893e4208dfe3f5c88ae12bc2f25d5
- *
- * There is no _sk_dst on older kernels, so just set the
- * old dst to NULL and release it directly.
- */
-static inline void skb_dst_drop(struct sk_buff *skb)
-{
-	dst_release(skb->dst);
-	skb->dst = NULL;
-}
-
-static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
-{
-	return (struct dst_entry *)skb->dst;
-}
-
-static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
-{
-	skb->dst = dst;
-}
-
-static inline struct rtable *skb_rtable(const struct sk_buff *skb)
-{
-	return (struct rtable *)skb_dst(skb);
-}
-
-/* Backport threaded IRQ support */
-
-static inline
-void compat_irq_work(struct work_struct *work)
-{
-	struct compat_threaded_irq *comp = container_of(work, struct compat_threaded_irq, work);
-	comp->thread_fn(comp->irq, comp->dev_id);
-}
-
-static inline
-irqreturn_t compat_irq_dispatcher(int irq, void *dev_id)
-{
-	struct compat_threaded_irq *comp = dev_id;
-	irqreturn_t res;
-
-	res = comp->handler(irq, comp->dev_id);
-	if (res == IRQ_WAKE_THREAD) {
-		queue_work(comp->wq, &comp->work);
-		res = IRQ_HANDLED;
-	}
-
-	return res;
-}
-
-static inline
-int compat_request_threaded_irq(struct compat_threaded_irq *comp,
-				unsigned int irq,
-				irq_handler_t handler,
-				irq_handler_t thread_fn,
-				unsigned long flags,
-				const char *name,
-				void *dev_id)
-{
-	comp->irq = irq;
-	comp->handler = handler;
-	comp->thread_fn = thread_fn;
-	comp->dev_id = dev_id;
-	INIT_WORK(&comp->work, compat_irq_work);
-
-	if (!comp->wq) {
-		snprintf(comp->wq_name, sizeof(comp->wq_name),
-			 "compirq/%u-%s", irq, name);
-		comp->wq = create_singlethread_workqueue(comp->wq_name);
-		if (!comp->wq) {
-			printk(KERN_ERR "Failed to create compat-threaded-IRQ workqueue %s\n",
-			       comp->wq_name);
-			return -ENOMEM;
-		}
-	}
-	return request_irq(irq, compat_irq_dispatcher, flags, name, comp);
-}
-
-static inline
-void compat_free_threaded_irq(struct compat_threaded_irq *comp)
-{
-	free_irq(comp->irq, comp);
-}
-
-static inline
-void compat_destroy_threaded_irq(struct compat_threaded_irq *comp)
-{
-	if (comp->wq)
-		destroy_workqueue(comp->wq);
-	comp->wq = NULL;
-}
-
-static inline
-void compat_synchronize_threaded_irq(struct compat_threaded_irq *comp)
-{
-	synchronize_irq(comp->irq);
-	cancel_work_sync(&comp->work);
-}
-
-/**
- * list_entry_rcu - get the struct for this entry
- * @ptr:        the &struct list_head pointer.
- * @type:       the type of the struct this is embedded in.
- * @member:     the name of the list_struct within the struct.
- *
- * This primitive may safely run concurrently with the _rcu list-mutation
- * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
- */
-#define list_entry_rcu(ptr, type, member) \
-	container_of(rcu_dereference(ptr), type, member)
-
-#define skb_walk_frags(skb, iter)	\
-	for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)
-
-#ifndef CONFIG_64BIT
-
-typedef struct {
-	long long counter;
-} atomic64_t;
-
-#define atomic64_read LINUX_BACKPORT(atomic64_read)
-extern long long atomic64_read(const atomic64_t *v);
-#define atomic64_add_return LINUX_BACKPORT(atomic64_add_return)
-extern long long atomic64_add_return(long long a, atomic64_t *v);
-
-#define atomic64_inc_return(v)          atomic64_add_return(1LL, (v))
-
-#endif
-
-/**
- * sk_rmem_alloc_get - returns read allocations
- * @sk: socket
- *
- * Returns sk_rmem_alloc
- */
-static inline int sk_rmem_alloc_get(const struct sock *sk)
-{
-	return atomic_read(&sk->sk_rmem_alloc);
-}
-
-/**
- * sk_wmem_alloc_get - returns write allocations
- * @sk: socket
- *
- * Returns sk_wmem_alloc minus initial offset of one
- */
-static inline int sk_wmem_alloc_get(const struct sock *sk)
-{
-	return atomic_read(&sk->sk_wmem_alloc) - 1;
-}
-
-/**
- * sk_has_allocations - check if allocations are outstanding
- * @sk: socket
- *
- * Returns true if socket has write or read allocations
- */
-static inline bool sk_has_allocations(const struct sock *sk)
-{
-	return sk_wmem_alloc_get(sk) || sk_rmem_alloc_get(sk);
-}
-
-#define USB_SUBCLASS_VENDOR_SPEC	0xff
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
-
-#endif /* LINUX_26_31_COMPAT_H */
diff --git a/backport/backport-include/linux/ethtool.h b/backport/backport-include/linux/ethtool.h
index 2236d0e..4fb3dcc 100644
--- a/backport/backport-include/linux/ethtool.h
+++ b/backport/backport-include/linux/ethtool.h
@@ -14,4 +14,18 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
 #define ETHTOOL_FWVERS_LEN 32
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+#define SUPPORTED_Backplane            (1 << 16)
+#define SUPPORTED_1000baseKX_Full      (1 << 17)
+#define SUPPORTED_10000baseKX4_Full    (1 << 18)
+#define SUPPORTED_10000baseKR_Full     (1 << 19)
+#define SUPPORTED_10000baseR_FEC       (1 << 20)
+
+#define ADVERTISED_Backplane           (1 << 16)
+#define ADVERTISED_1000baseKX_Full     (1 << 17)
+#define ADVERTISED_10000baseKX4_Full   (1 << 18)
+#define ADVERTISED_10000baseKR_Full    (1 << 19)
+#define ADVERTISED_10000baseR_FEC      (1 << 20)
+#endif
+
 #endif /* __BACKPORT_LINUX_ETHTOOL_H */
diff --git a/backport/backport-include/linux/interrupt.h b/backport/backport-include/linux/interrupt.h
index 908ef36..546a7fb 100644
--- a/backport/backport-include/linux/interrupt.h
+++ b/backport/backport-include/linux/interrupt.h
@@ -25,4 +25,87 @@ static inline int irq_set_affinity_hint(unsigned int irq,
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+struct compat_threaded_irq {
+	unsigned int irq;
+	irq_handler_t handler;
+	irq_handler_t thread_fn;
+	void *dev_id;
+	char wq_name[64];
+	struct workqueue_struct *wq;
+	struct work_struct work;
+};
+
+static inline
+void compat_irq_work(struct work_struct *work)
+{
+	struct compat_threaded_irq *comp = container_of(work, struct compat_threaded_irq, work);
+	comp->thread_fn(comp->irq, comp->dev_id);
+}
+
+static inline
+irqreturn_t compat_irq_dispatcher(int irq, void *dev_id)
+{
+	struct compat_threaded_irq *comp = dev_id;
+	irqreturn_t res;
+
+	res = comp->handler(irq, comp->dev_id);
+	if (res == IRQ_WAKE_THREAD) {
+		queue_work(comp->wq, &comp->work);
+		res = IRQ_HANDLED;
+	}
+
+	return res;
+}
+
+static inline
+int compat_request_threaded_irq(struct compat_threaded_irq *comp,
+				unsigned int irq,
+				irq_handler_t handler,
+				irq_handler_t thread_fn,
+				unsigned long flags,
+				const char *name,
+				void *dev_id)
+{
+	comp->irq = irq;
+	comp->handler = handler;
+	comp->thread_fn = thread_fn;
+	comp->dev_id = dev_id;
+	INIT_WORK(&comp->work, compat_irq_work);
+
+	if (!comp->wq) {
+		snprintf(comp->wq_name, sizeof(comp->wq_name),
+			 "compirq/%u-%s", irq, name);
+		comp->wq = create_singlethread_workqueue(comp->wq_name);
+		if (!comp->wq) {
+			printk(KERN_ERR "Failed to create compat-threaded-IRQ workqueue %s\n",
+			       comp->wq_name);
+			return -ENOMEM;
+		}
+	}
+	return request_irq(irq, compat_irq_dispatcher, flags, name, comp);
+}
+
+static inline
+void compat_free_threaded_irq(struct compat_threaded_irq *comp)
+{
+	free_irq(comp->irq, comp);
+}
+
+static inline
+void compat_destroy_threaded_irq(struct compat_threaded_irq *comp)
+{
+	if (comp->wq)
+		destroy_workqueue(comp->wq);
+	comp->wq = NULL;
+}
+
+static inline
+void compat_synchronize_threaded_irq(struct compat_threaded_irq *comp)
+{
+	synchronize_irq(comp->irq);
+	cancel_work_sync(&comp->work);
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_INTERRUPT_H */
diff --git a/backport/backport-include/linux/kmemleak.h b/backport/backport-include/linux/kmemleak.h
index 83bd199..99fff66 100644
--- a/backport/backport-include/linux/kmemleak.h
+++ b/backport/backport-include/linux/kmemleak.h
@@ -2,4 +2,23 @@
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
 #include_next <linux/kmemleak.h>
-#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)) */
+#else
+/*
+ * kmemleak was introduced on 2.6.31, since older kernels do not have
+ * we simply ignore its tuning.
+ */
+static inline void kmemleak_ignore(const void *ptr)
+{
+	return;
+}
+
+static inline void kmemleak_not_leak(const void *ptr)
+{
+	return;
+}
+
+static inline void kmemleak_no_scan(const void *ptr)
+{
+	return;
+}
+#endif
diff --git a/backport/backport-include/linux/mdio.h b/backport/backport-include/linux/mdio.h
new file mode 100644
index 0000000..888bfee
--- /dev/null
+++ b/backport/backport-include/linux/mdio.h
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_LINUX_MDIO_H
+#define __BACKPORT_LINUX_MDIO_H
+#include_next <linux/mdio.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+#define mdio45_probe LINUX_BACKPORT(mdio45_probe)
+#define mdio_set_flag LINUX_BACKPORT(mdio_set_flag)
+#define mdio45_links_ok LINUX_BACKPORT(mdio45_links_ok)
+#define mdio45_nway_restart LINUX_BACKPORT(mdio45_nway_restart)
+
+#define mdio45_ethtool_gset_npage LINUX_BACKPORT(mdio45_ethtool_gset_npage)
+#define mdio45_ethtool_spauseparam_an LINUX_BACKPORT(mdio45_ethtool_spauseparam_an)
+#define mdio_mii_ioctl LINUX_BACKPORT(mdio_mii_ioctl)
+#endif
+
+#endif /* __BACKPORT_LINUX_MDIO_H */
diff --git a/backport/backport-include/linux/mmc/sdio_ids.h b/backport/backport-include/linux/mmc/sdio_ids.h
index 3223fca..64fe8ec 100644
--- a/backport/backport-include/linux/mmc/sdio_ids.h
+++ b/backport/backport-include/linux/mmc/sdio_ids.h
@@ -7,4 +7,8 @@
 #define SDIO_CLASS_BT_AMP	0x09	/* Type-A Bluetooth AMP interface */
 #endif
 
+#ifndef SDIO_DEVICE_ID_MARVELL_8688WLAN
+#define SDIO_DEVICE_ID_MARVELL_8688WLAN		0x9104
+#endif
+
 #endif /* __BACKPORT_MMC_SDIO_IDS_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index ee4f410..0300ca0 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -291,4 +291,8 @@ do {								\
 #define NETDEV_POST_INIT 0xffff
 #endif
 
+#ifndef NETDEV_PRE_UP
+#define NETDEV_PRE_UP		0x000D
+#endif
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/rculist.h b/backport/backport-include/linux/rculist.h
index bb9f367..73c47df 100644
--- a/backport/backport-include/linux/rculist.h
+++ b/backport/backport-include/linux/rculist.h
@@ -46,4 +46,9 @@
 	     pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
 #endif
 
+#ifndef list_entry_rcu
+#define list_entry_rcu(ptr, type, member) \
+	container_of(rcu_dereference(ptr), type, member)
+#endif
+
 #endif /* __BACKPORT_RCULIST_H */
diff --git a/backport/backport-include/linux/rfkill.h b/backport/backport-include/linux/rfkill.h
index da236b2..01d18f1 100644
--- a/backport/backport-include/linux/rfkill.h
+++ b/backport/backport-include/linux/rfkill.h
@@ -1,9 +1,25 @@
 #ifndef __COMPAT_RFKILL_H
 #define __COMPAT_RFKILL_H
+#include <linux/version.h>
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
 #include_next <linux/rfkill.h>
 #else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+#define rfkill_get_led_trigger_name LINUX_BACKPORT(rfkill_get_led_trigger_name)
+#define rfkill_set_led_trigger_name LINUX_BACKPORT(rfkill_set_led_trigger_name)
+#define rfkill_set_hw_state LINUX_BACKPORT(rfkill_set_hw_state)
+#define rfkill_set_sw_state LINUX_BACKPORT(rfkill_set_sw_state)
+#define rfkill_init_sw_state LINUX_BACKPORT(rfkill_init_sw_state)
+#define rfkill_set_states LINUX_BACKPORT(rfkill_set_states)
+#define rfkill_pause_polling LINUX_BACKPORT(rfkill_pause_polling)
+#define rfkill_resume_polling LINUX_BACKPORT(rfkill_resume_polling)
+#define rfkill_blocked LINUX_BACKPORT(rfkill_blocked)
+#define rfkill_alloc LINUX_BACKPORT(rfkill_alloc)
+#define rfkill_register LINUX_BACKPORT(rfkill_register)
+#define rfkill_unregister LINUX_BACKPORT(rfkill_unregister)
+#define rfkill_destroy LINUX_BACKPORT(rfkill_destroy)
+#endif
 #include <linux/rfkill_backport.h>
 #endif
 
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index e7f667e..cc145a6 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -117,4 +117,9 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
 }
 #endif
 
+#ifndef skb_walk_frags
+#define skb_walk_frags(skb, iter)	\
+	for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index 79ac140..4ed9617 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -92,4 +92,9 @@ static inline void usb_autopm_put_interface_no_suspend(struct usb_interface *int
 #endif /* CONFIG_USB_SUSPEND */
 #endif /* < 2.6.33 */
 
+#ifndef USB_SUBCLASS_VENDOR_SPEC
+/* this is defined in usb/ch9.h, but we only need it through here */
+#define USB_SUBCLASS_VENDOR_SPEC	0xff
+#endif
+
 #endif /* __BACKPORT_USB_H */
diff --git a/backport/backport-include/net/dst.h b/backport/backport-include/net/dst.h
new file mode 100644
index 0000000..e4e3d8f
--- /dev/null
+++ b/backport/backport-include/net/dst.h
@@ -0,0 +1,35 @@
+#ifndef __BACKPORT_NET_DST_H
+#define __BACKPORT_NET_DST_H
+#include_next <net/dst.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+/*
+ * Added via adf30907d63893e4208dfe3f5c88ae12bc2f25d5
+ *
+ * There is no _sk_dst on older kernels, so just set the
+ * old dst to NULL and release it directly.
+ */
+static inline void skb_dst_drop(struct sk_buff *skb)
+{
+	dst_release(skb->dst);
+	skb->dst = NULL;
+}
+
+static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
+{
+	return (struct dst_entry *)skb->dst;
+}
+
+static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
+{
+	skb->dst = dst;
+}
+
+static inline struct rtable *skb_rtable(const struct sk_buff *skb)
+{
+	return (struct rtable *)skb_dst(skb);
+}
+#endif
+
+#endif /* __BACKPORT_NET_DST_H */
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
index 93dc6a8..b4f3e6a 100644
--- a/backport/backport-include/net/sock.h
+++ b/backport/backport-include/net/sock.h
@@ -56,4 +56,21 @@ static inline struct sock *sk_entry(const struct hlist_node *node)
 #define sock_recv_ts_and_drops(msg, sk, skb) sock_recv_timestamp(msg, sk, skb)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+static inline int sk_rmem_alloc_get(const struct sock *sk)
+{
+	return atomic_read(&sk->sk_rmem_alloc);
+}
+
+static inline int sk_wmem_alloc_get(const struct sock *sk)
+{
+	return atomic_read(&sk->sk_wmem_alloc) - 1;
+}
+
+static inline bool sk_has_allocations(const struct sock *sk)
+{
+	return sk_wmem_alloc_get(sk) || sk_rmem_alloc_get(sk);
+}
+#endif
+
 #endif /* __BACKPORT_NET_SOCK_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 30/42] backports: dissolve compat-2.6.30.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (28 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 29/42] backports: dissolve compat-2.6.31.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 31/42] backports: dissolve compat-2.6.29.h Johannes Berg
                   ` (14 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-2.6.30.h | 53 -------------------------
 backport/backport-include/linux/device.h        |  7 ++++
 backport/backport-include/linux/hid.h           |  4 +-
 backport/backport-include/linux/interrupt.h     |  4 ++
 backport/backport-include/linux/pci_regs.h      |  8 ++++
 backport/backport-include/linux/pm.h            |  9 +++++
 backport/backport-include/linux/printk.h        | 11 +++++
 7 files changed, 42 insertions(+), 54 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.30.h

diff --git a/backport/backport-include/linux/compat-2.6.30.h b/backport/backport-include/linux/compat-2.6.30.h
deleted file mode 100644
index 5841b6c..0000000
--- a/backport/backport-include/linux/compat-2.6.30.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef LINUX_26_30_COMPAT_H
-#define LINUX_26_30_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
-
-#include <linux/device.h>
-#include <linux/pci_regs.h>
-
-#define HID_QUIRK_IGNORE                       0x00000004
-
-#ifndef TP_PROTO
-#define TP_PROTO(args...)	TPPROTO(args)
-#endif
-#ifndef TP_ARGS
-#define TP_ARGS(args...)	TPARGS(args)
-#endif
-
-#define IRQ_WAKE_THREAD	(2)
-
-/* From : include/linux/pm.h */
-/* How to reorder dpm_list after device_move() */
-enum dpm_order {
-	DPM_ORDER_NONE,
-	DPM_ORDER_DEV_AFTER_PARENT,
-	DPM_ORDER_PARENT_BEFORE_DEV,
-	DPM_ORDER_DEV_LAST,
-};
-
-static inline void dev_set_uevent_suppress(struct device *dev, int val)
-{
-	dev->uevent_suppress = val;
-}
-
-/*
- * Print a one-time message (analogous to WARN_ONCE() et al):
- */
-#define printk_once(x...) ({			\
-	static bool __print_once;		\
-						\
-	if (!__print_once) {			\
-		__print_once = true;		\
-		printk(x);			\
-	}					\
-})
-
-#define PCI_EXP_LNKCTL2			48      /* Link Control 2 */
-#define PCI_EXP_SLTCTL2			56      /* Slot Control 2 */
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)) */
-
-#endif /* LINUX_26_30_COMPAT_H */
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 0e45c1b..516cc31 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -122,4 +122,11 @@ static inline void device_unlock(struct device *dev)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+static inline void dev_set_uevent_suppress(struct device *dev, int val)
+{
+	dev->uevent_suppress = val;
+}
+#endif
+
 #endif /* __BACKPORT_DEVICE_H */
diff --git a/backport/backport-include/linux/hid.h b/backport/backport-include/linux/hid.h
index b642ece..4ad740a 100644
--- a/backport/backport-include/linux/hid.h
+++ b/backport/backport-include/linux/hid.h
@@ -20,6 +20,8 @@ extern bool hid_ignore(struct hid_device *);
 #define HID_QUIRK_HIDDEV_FORCE                 0x00000010
 #endif
 
-
+#ifndef HID_QUIRK_IGNORE
+#define HID_QUIRK_IGNORE                       0x00000004
+#endif
 
 #endif /* __BACKPORT_HID_H */
diff --git a/backport/backport-include/linux/interrupt.h b/backport/backport-include/linux/interrupt.h
index 546a7fb..9e51303 100644
--- a/backport/backport-include/linux/interrupt.h
+++ b/backport/backport-include/linux/interrupt.h
@@ -25,6 +25,10 @@ static inline int irq_set_affinity_hint(unsigned int irq,
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+#define IRQ_WAKE_THREAD	(2)
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 struct compat_threaded_irq {
 	unsigned int irq;
diff --git a/backport/backport-include/linux/pci_regs.h b/backport/backport-include/linux/pci_regs.h
index d97e57f..f7bfd9a 100644
--- a/backport/backport-include/linux/pci_regs.h
+++ b/backport/backport-include/linux/pci_regs.h
@@ -95,4 +95,12 @@
 #define  PCI_MSIX_ENTRY_VECTOR_CTRL    12
 #endif
 
+#ifndef PCI_EXP_LNKCTL2
+#define PCI_EXP_LNKCTL2			48      /* Link Control 2 */
+#endif
+
+#ifndef PCI_EXP_SLTCTL2
+#define PCI_EXP_SLTCTL2			56      /* Slot Control 2 */
+#endif
+
 #endif /* __BACKPORT_UAPI_PCI_REGS_H */
diff --git a/backport/backport-include/linux/pm.h b/backport/backport-include/linux/pm.h
index 4e30652..a78477c 100644
--- a/backport/backport-include/linux/pm.h
+++ b/backport/backport-include/linux/pm.h
@@ -55,4 +55,13 @@ struct dev_pm_ops name = { \
 #endif /* >= 2.6.29 */
 #endif /* < 2.6.32 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+enum dpm_order {
+	DPM_ORDER_NONE,
+	DPM_ORDER_DEV_AFTER_PARENT,
+	DPM_ORDER_PARENT_BEFORE_DEV,
+	DPM_ORDER_DEV_LAST,
+};
+#endif
+
 #endif /* __BACKPORT_PM_H */
diff --git a/backport/backport-include/linux/printk.h b/backport/backport-include/linux/printk.h
index c110888..b97f51e 100644
--- a/backport/backport-include/linux/printk.h
+++ b/backport/backport-include/linux/printk.h
@@ -39,6 +39,17 @@ do {                                                           \
 #define pr_warn pr_warning
 #endif
 
+#ifndef printk_once
+#define printk_once(x...) ({			\
+	static bool __print_once;		\
+						\
+	if (!__print_once) {			\
+		__print_once = true;		\
+		printk(x);			\
+	}					\
+})
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
 #define pr_emerg_once(fmt, ...)					\
 	printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 31/42] backports: dissolve compat-2.6.29.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (29 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 30/42] backports: dissolve compat-2.6.30.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 32/42] backports: dissolve compat-2.6.28.h Johannes Berg
                   ` (13 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-2.6.29.h | 431 ------------------------
 backport/backport-include/linux/etherdevice.h   |   9 +
 backport/backport-include/linux/kernel.h        |  12 +
 backport/backport-include/linux/netdevice.h     | 110 ++++++
 backport/backport-include/linux/pci.h           |  67 ++++
 backport/backport-include/linux/pci_regs.h      |   8 +
 backport/backport-include/linux/skbuff.h        |  15 +
 backport/backport-include/linux/types.h         |  26 ++
 backport/backport-include/linux/usb.h           |  15 +
 backport/backport-include/net/net_namespace.h   |  18 +
 10 files changed, 280 insertions(+), 431 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.29.h

diff --git a/backport/backport-include/linux/compat-2.6.29.h b/backport/backport-include/linux/compat-2.6.29.h
deleted file mode 100644
index adcde36..0000000
--- a/backport/backport-include/linux/compat-2.6.29.h
+++ /dev/null
@@ -1,431 +0,0 @@
-#ifndef LINUX_26_29_COMPAT_H
-#define LINUX_26_29_COMPAT_H
-
-#include <linux/version.h>
-struct net_device;
-#include <linux/netdevice.h>
-#include <linux/if_link.h>
-
-/*
- * I kow this looks odd.. but 2.6.32 added the netdev_tx_t
- * and we backport that there so inlcude that header first
- * as we need it for the netdev ops.
- */
-#include <linux/compat-2.6.32.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
-
-#include <linux/skbuff.h>
-#include <linux/usb.h>
-#include <linux/types.h>
-#include <linux/pci_regs.h>
-
-#define napi_gro_receive(napi, skb) netif_receive_skb(skb)
-
-/* backports  */
-static inline void usb_autopm_put_interface_async(struct usb_interface *intf)
-{ }
-static inline int usb_autopm_get_interface_async(struct usb_interface *intf)
-{ return 0; }
-
-#if \
-	defined(CONFIG_ALPHA) || defined(CONFIG_AVR32) || \
-	defined(CONFIG_BLACKFIN) || defined(CONFIG_CRIS) || \
-	defined(CONFIG_H8300) || defined(CONFIG_IA64) || \
-	defined(CONFIG_M68K) ||  defined(CONFIG_MIPS) || \
-	defined(CONFIG_PARISC) || defined(CONFIG_S390) || \
-	defined(CONFIG_PPC64) || defined(CONFIG_PPC32) || \
-	defined(CONFIG_SUPERH) || defined(CONFIG_SPARC) || \
-	defined(CONFIG_FRV) || defined(CONFIG_X86) || \
-	defined(CONFIG_M32R) || defined(CONFIG_M68K) || \
-	defined(CONFIG_MN10300) || defined(CONFIG_XTENSA) || \
-	defined(CONFIG_ARM)
-#include <asm/atomic.h>
-#else
-typedef struct {
-	volatile int counter;
-} atomic_t;
-
-#ifdef CONFIG_64BIT
-typedef struct {
-	volatile long counter;
-} atomic64_t;
-#endif /* CONFIG_64BIT */
-
-#endif
-
-#define  PCI_EXP_LNKCTL_ES     0x0080  /* Extended Synch */
-
-/*
- * Older kernels do not have struct net_device_ops but what we can
- * do is just define the data structure and use a caller to let us
- * set the data structure's routines onto the old netdev, essentially
- * doing it the old way. This avoids huge deltas on our backports.
- */
-
-/*
- * This structure defines the management hooks for network devices.
- * The following hooks can be defined; unless noted otherwise, they are
- * optional and can be filled with a null pointer.
- *
- * int (*ndo_init)(struct net_device *dev);
- *     This function is called once when network device is registered.
- *     The network device can use this to any late stage initializaton
- *     or semantic validattion. It can fail with an error code which will
- *     be propogated back to register_netdev
- *
- * void (*ndo_uninit)(struct net_device *dev);
- *     This function is called when device is unregistered or when registration
- *     fails. It is not called if init fails.
- *
- * int (*ndo_open)(struct net_device *dev);
- *     This function is called when network device transistions to the up
- *     state.
- *
- * int (*ndo_stop)(struct net_device *dev);
- *     This function is called when network device transistions to the down
- *     state.
- *
- * netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
- *                               struct net_device *dev);
- *	Called when a packet needs to be transmitted.
- *	Must return NETDEV_TX_OK , NETDEV_TX_BUSY.
- *        (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX)
- *	Required can not be NULL.
- *
- * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb);
- *	Called to decide which queue to when device supports multiple
- *	transmit queues.
- *
- * void (*ndo_change_rx_flags)(struct net_device *dev, int flags);
- *	This function is called to allow device receiver to make
- *	changes to configuration when multicast or promiscious is enabled.
- *
- * void (*ndo_set_rx_mode)(struct net_device *dev);
- *	This function is called device changes address list filtering.
- *
- * void (*ndo_set_multicast_list)(struct net_device *dev);
- *	This function is called when the multicast address list changes.
- *
- * int (*ndo_set_mac_address)(struct net_device *dev, void *addr);
- *	This function  is called when the Media Access Control address
- *	needs to be changed. If this interface is not defined, the
- *	mac address can not be changed.
- *
- * int (*ndo_validate_addr)(struct net_device *dev);
- *	Test if Media Access Control address is valid for the device.
- *
- * int (*ndo_do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);
- *	Called when a user request an ioctl which can't be handled by
- *	the generic interface code. If not defined ioctl's return
- *	not supported error code.
- *
- * int (*ndo_set_config)(struct net_device *dev, struct ifmap *map);
- *	Used to set network devices bus interface parameters. This interface
- *	is retained for legacy reason, new devices should use the bus
- *	interface (PCI) for low level management.
- *
- * int (*ndo_change_mtu)(struct net_device *dev, int new_mtu);
- *	Called when a user wants to change the Maximum Transfer Unit
- *	of a device. If not defined, any request to change MTU will
- *	will return an error.
- *
- * void (*ndo_tx_timeout)(struct net_device *dev);
- *	Callback uses when the transmitter has not made any progress
- *	for dev->watchdog ticks.
- *
- * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
- *	Called when a user wants to get the network device usage
- *	statistics. If not defined, the counters in dev->stats will
- *	be used.
- *
- * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp);
- *	If device support VLAN receive accleration
- *	(ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called
- *	when vlan groups for the device changes.  Note: grp is NULL
- *	if no vlan's groups are being used.
- *
- * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid);
- *	If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
- *	this function is called when a VLAN id is registered.
- *
- * void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid);
- *	If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
- *	this function is called when a VLAN id is unregistered.
- *
- * void (*ndo_poll_controller)(struct net_device *dev);
- *
- *	SR-IOV management functions.
- * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac);
- * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos);
- * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate);
- * int (*ndo_get_vf_config)(struct net_device *dev,
- *			    int vf, struct ifla_vf_info *ivf);
- */
-#define HAVE_NET_DEVICE_OPS
-struct net_device_ops {
-	int			(*ndo_init)(struct net_device *dev);
-	void			(*ndo_uninit)(struct net_device *dev);
-	int			(*ndo_open)(struct net_device *dev);
-	int			(*ndo_stop)(struct net_device *dev);
-	netdev_tx_t		(*ndo_start_xmit) (struct sk_buff *skb,
-						   struct net_device *dev);
-	u16			(*ndo_select_queue)(struct net_device *dev,
-						    struct sk_buff *skb);
-	void			(*ndo_change_rx_flags)(struct net_device *dev,
-						       int flags);
-	void			(*ndo_set_rx_mode)(struct net_device *dev);
-	void			(*ndo_set_multicast_list)(struct net_device *dev);
-	int			(*ndo_set_mac_address)(struct net_device *dev,
-						       void *addr);
-	int			(*ndo_validate_addr)(struct net_device *dev);
-	int			(*ndo_do_ioctl)(struct net_device *dev,
-					        struct ifreq *ifr, int cmd);
-	int			(*ndo_set_config)(struct net_device *dev,
-					          struct ifmap *map);
-	int			(*ndo_change_mtu)(struct net_device *dev,
-						  int new_mtu);
-	int			(*ndo_neigh_setup)(struct net_device *dev,
-						   struct neigh_parms *);
-	void			(*ndo_tx_timeout) (struct net_device *dev);
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
-	struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev,
-						     struct rtnl_link_stats64 *storage);
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
-
-	struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
-
-	void			(*ndo_vlan_rx_register)(struct net_device *dev,
-						        struct vlan_group *grp);
-	void			(*ndo_vlan_rx_add_vid)(struct net_device *dev,
-						       unsigned short vid);
-	void			(*ndo_vlan_rx_kill_vid)(struct net_device *dev,
-						        unsigned short vid);
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	void                    (*ndo_poll_controller)(struct net_device *dev);
-#endif
-	int			(*ndo_set_vf_mac)(struct net_device *dev,
-						  int queue, u8 *mac);
-	int			(*ndo_set_vf_vlan)(struct net_device *dev,
-						   int queue, u16 vlan, u8 qos);
-	int			(*ndo_set_vf_tx_rate)(struct net_device *dev,
-						      int vf, int rate);
-/*
- * The struct ifla_vf_info was added via b280da8d54b8d82b52f368a8703b7ada6c1744d5
- * on the v2.6.34-rc1~233^2~338 release
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
-	int			(*ndo_get_vf_config)(struct net_device *dev,
-						     int vf,
-						     struct ifla_vf_info *ivf);
-#endif
-#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
-	int			(*ndo_fcoe_enable)(struct net_device *dev);
-	int			(*ndo_fcoe_disable)(struct net_device *dev);
-	int			(*ndo_fcoe_ddp_setup)(struct net_device *dev,
-						      u16 xid,
-						      struct scatterlist *sgl,
-						      unsigned int sgc);
-	int			(*ndo_fcoe_ddp_done)(struct net_device *dev,
-						     u16 xid);
-#define NETDEV_FCOE_WWNN 0
-#define NETDEV_FCOE_WWPN 1
-	int			(*ndo_fcoe_get_wwn)(struct net_device *dev,
-						    u64 *wwn, int type);
-#endif
-};
-
-static inline int ndo_do_ioctl(struct net_device *dev,
-			       struct ifreq *ifr,
-			       int cmd)
-{
-	if (dev->do_ioctl)
-		return dev->do_ioctl(dev, ifr, cmd);
-	return -EOPNOTSUPP;
-}
-
-
-#define netdev_attach_ops LINUX_BACKPORT(netdev_attach_ops)
-void netdev_attach_ops(struct net_device *dev,
-		       const struct net_device_ops *ops);
-
-/**
- *	skb_queue_is_first - check if skb is the first entry in the queue
- *	@list: queue head
- *	@skb: buffer
- *
- *	Returns true if @skb is the first buffer on the list.
- */
-static inline bool skb_queue_is_first(const struct sk_buff_head *list,
-				      const struct sk_buff *skb)
-{
-	return (skb->prev == (struct sk_buff *) list);
-}
-
-/**
- *	skb_queue_prev - return the prev packet in the queue
- *	@list: queue head
- *	@skb: current buffer
- *
- *	Return the prev packet in @list before @skb.  It is only valid to
- *	call this if skb_queue_is_first() evaluates to false.
- */
-static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list,
-					     const struct sk_buff *skb)
-{
-	/* This BUG_ON may seem severe, but if we just return then we
-	 * are going to dereference garbage.
-	 */
-	BUG_ON(skb_queue_is_first(list, skb));
-	return skb->prev;
-}
-
-
-static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
-{
-	return dev->get_stats(dev);
-}
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
-#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
-#define usb_unpoison_anchored_urbs LINUX_BACKPORT(usb_unpoison_anchored_urbs)
-extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
-#endif /* CONFIG_USB */
-#endif
-
-#define DIV_ROUND_CLOSEST(x, divisor)(			\
-{							\
-	typeof(divisor) __divisor = divisor;		\
-	(((x) + ((__divisor) / 2)) / (__divisor));	\
-}							\
-)
-
-#define eth_mac_addr LINUX_BACKPORT(eth_mac_addr)
-extern int eth_mac_addr(struct net_device *dev, void *p);
-#define eth_change_mtu LINUX_BACKPORT(eth_change_mtu)
-extern int eth_change_mtu(struct net_device *dev, int new_mtu);
-#define eth_validate_addr LINUX_BACKPORT(eth_validate_addr)
-extern int eth_validate_addr(struct net_device *dev);
-
-#ifdef CONFIG_NET_NS
-
-static inline void write_pnet(struct net **pnet, struct net *net)
-{
-	*pnet = net;
-}
-
-static inline struct net *read_pnet(struct net * const *pnet)
-{
-	return *pnet;
-}
-
-#else
-
-#define write_pnet(pnet, net)	do { (void)(net);} while (0)
-#define read_pnet(pnet)		(&init_net)
-
-/*
- * swap - swap value of @a and @b
- */
-#define swap(a, b) \
-	do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
-
-#endif
-
-#define init_dummy_netdev LINUX_BACKPORT(init_dummy_netdev)
-extern int		init_dummy_netdev(struct net_device *dev);
-
-#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
-
-/* Kernels >= 2.6.29 follows */
-
-/* XXX: this can probably just go upstream ! */
-static inline void netdev_attach_ops(struct net_device *dev,
-		       const struct net_device_ops *ops)
-{
-	dev->netdev_ops = ops;
-}
-
-/* XXX: this can probably just go upstream! */
-static inline int ndo_do_ioctl(struct net_device *dev,
-			       struct ifreq *ifr,
-			       int cmd)
-{
-	if (dev->netdev_ops && dev->netdev_ops->ndo_do_ioctl)
-		return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
-	return -EOPNOTSUPP;
-}
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
-#define compat_pci_suspend(fn)						\
-	int fn##_compat(struct pci_dev *pdev, pm_message_t state) 	\
-	{								\
-		int r;							\
-									\
-		r = fn(&pdev->dev);					\
-		if (r)							\
-			return r;					\
-									\
-		pci_save_state(pdev);					\
-		pci_disable_device(pdev);				\
-		pci_set_power_state(pdev, PCI_D3hot);			\
-									\
-		return 0;						\
-	}
-
-#define compat_pci_resume(fn)						\
-	int fn##_compat(struct pci_dev *pdev)				\
-	{								\
-		int r;							\
-									\
-		pci_set_power_state(pdev, PCI_D0);			\
-		r = pci_enable_device(pdev);				\
-		if (r)							\
-			return r;					\
-		pci_restore_state(pdev);				\
-									\
-		return fn(&pdev->dev);					\
-	}
-#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,29)
-#define compat_pci_suspend(fn)						\
-	int fn##_compat(struct device *dev)			 	\
-	{								\
-		struct pci_dev *pdev = to_pci_dev(dev);			\
-		int r;							\
-									\
-		r = fn(&pdev->dev);					\
-		if (r)							\
-			return r;					\
-									\
-		pci_save_state(pdev);					\
-		pci_disable_device(pdev);				\
-		pci_set_power_state(pdev, PCI_D3hot);			\
-									\
-		return 0;						\
-	}
-
-#define compat_pci_resume(fn)						\
-	int fn##_compat(struct device *dev)				\
-	{								\
-		struct pci_dev *pdev = to_pci_dev(dev);			\
-		int r;							\
-									\
-		pci_set_power_state(pdev, PCI_D0);			\
-		r = pci_enable_device(pdev);				\
-		if (r)							\
-			return r;					\
-		pci_restore_state(pdev);				\
-									\
-		return fn(&pdev->dev);					\
-	}
-#else
-#define compat_pci_suspend(fn)
-#define compat_pci_resume(fn)
-#endif
-
-#define  PCI_EXP_SLTSTA_PDS	0x0040  /* Presence Detect State */
-
-#endif /*  LINUX_26_29_COMPAT_H */
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index b35735d..03208b6 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -103,6 +103,15 @@ static inline int is_unicast_ether_addr(const u8 *addr)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+#define eth_mac_addr LINUX_BACKPORT(eth_mac_addr)
+extern int eth_mac_addr(struct net_device *dev, void *p);
+#define eth_change_mtu LINUX_BACKPORT(eth_change_mtu)
+extern int eth_change_mtu(struct net_device *dev, int new_mtu);
+#define eth_validate_addr LINUX_BACKPORT(eth_validate_addr)
+extern int eth_validate_addr(struct net_device *dev);
+#endif /* < 2.6.29 */
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
 #define netdev_hw_addr dev_mc_list
 #endif
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index f189f54..19ea0e9 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -190,4 +190,16 @@ int hex_to_bin(char ch);
 #define round_down(x, y) ((x) & ~__round_mask(x, y))
 #endif
 
+#ifndef DIV_ROUND_CLOSEST
+#define DIV_ROUND_CLOSEST(x, divisor) ({		\
+	typeof(divisor) __divisor = divisor;		\
+	(((x) + ((__divisor) / 2)) / (__divisor));	\
+})
+#endif
+
+#ifndef swap
+#define swap(a, b) \
+	do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
+#endif
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 0300ca0..dc08764 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -15,6 +15,84 @@
 typedef int netdev_tx_t;
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+/*
+ * Older kernels do not have struct net_device_ops but what we can
+ * do is just define the data structure and use a caller to let us
+ * set the data structure's routines onto the old netdev, essentially
+ * doing it the old way. This avoids huge deltas on our backports.
+ */
+#define HAVE_NET_DEVICE_OPS
+struct net_device_ops {
+	int			(*ndo_init)(struct net_device *dev);
+	void			(*ndo_uninit)(struct net_device *dev);
+	int			(*ndo_open)(struct net_device *dev);
+	int			(*ndo_stop)(struct net_device *dev);
+	netdev_tx_t		(*ndo_start_xmit) (struct sk_buff *skb,
+						   struct net_device *dev);
+	u16			(*ndo_select_queue)(struct net_device *dev,
+						    struct sk_buff *skb);
+	void			(*ndo_change_rx_flags)(struct net_device *dev,
+						       int flags);
+	void			(*ndo_set_rx_mode)(struct net_device *dev);
+	void			(*ndo_set_multicast_list)(struct net_device *dev);
+	int			(*ndo_set_mac_address)(struct net_device *dev,
+						       void *addr);
+	int			(*ndo_validate_addr)(struct net_device *dev);
+	int			(*ndo_do_ioctl)(struct net_device *dev,
+					        struct ifreq *ifr, int cmd);
+	int			(*ndo_set_config)(struct net_device *dev,
+					          struct ifmap *map);
+	int			(*ndo_change_mtu)(struct net_device *dev,
+						  int new_mtu);
+	int			(*ndo_neigh_setup)(struct net_device *dev,
+						   struct neigh_parms *);
+	void			(*ndo_tx_timeout) (struct net_device *dev);
+
+	struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
+
+	void			(*ndo_vlan_rx_register)(struct net_device *dev,
+						        struct vlan_group *grp);
+	void			(*ndo_vlan_rx_add_vid)(struct net_device *dev,
+						       unsigned short vid);
+	void			(*ndo_vlan_rx_kill_vid)(struct net_device *dev,
+						        unsigned short vid);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	void                    (*ndo_poll_controller)(struct net_device *dev);
+#endif
+	int			(*ndo_set_vf_mac)(struct net_device *dev,
+						  int queue, u8 *mac);
+	int			(*ndo_set_vf_vlan)(struct net_device *dev,
+						   int queue, u16 vlan, u8 qos);
+	int			(*ndo_set_vf_tx_rate)(struct net_device *dev,
+						      int vf, int rate);
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+	int			(*ndo_fcoe_enable)(struct net_device *dev);
+	int			(*ndo_fcoe_disable)(struct net_device *dev);
+	int			(*ndo_fcoe_ddp_setup)(struct net_device *dev,
+						      u16 xid,
+						      struct scatterlist *sgl,
+						      unsigned int sgc);
+	int			(*ndo_fcoe_ddp_done)(struct net_device *dev,
+						     u16 xid);
+#define NETDEV_FCOE_WWNN 0
+#define NETDEV_FCOE_WWPN 1
+	int			(*ndo_fcoe_get_wwn)(struct net_device *dev,
+						    u64 *wwn, int type);
+#endif
+};
+
+static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
+{
+	return dev->get_stats(dev);
+}
+
+#define init_dummy_netdev LINUX_BACKPORT(init_dummy_netdev)
+extern int init_dummy_netdev(struct net_device *dev);
+
+#define napi_gro_receive(napi, skb) netif_receive_skb(skb)
+#endif /* < 2.6.29 */
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
 #define netdev_set_default_ethtool_ops LINUX_BACKPORT(netdev_set_default_ethtool_ops)
 extern void netdev_set_default_ethtool_ops(struct net_device *dev,
@@ -28,6 +106,38 @@ extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_
 extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+#define netdev_attach_ops LINUX_BACKPORT(netdev_attach_ops)
+void netdev_attach_ops(struct net_device *dev,
+		       const struct net_device_ops *ops);
+
+static inline int ndo_do_ioctl(struct net_device *dev,
+			       struct ifreq *ifr,
+			       int cmd)
+{
+	if (dev->do_ioctl)
+		return dev->do_ioctl(dev, ifr, cmd);
+	return -EOPNOTSUPP;
+}
+#else
+/* XXX: this can probably just go upstream ! */
+static inline void netdev_attach_ops(struct net_device *dev,
+		       const struct net_device_ops *ops)
+{
+	dev->netdev_ops = ops;
+}
+
+/* XXX: this can probably just go upstream! */
+static inline int ndo_do_ioctl(struct net_device *dev,
+			       struct ifreq *ifr,
+			       int cmd)
+{
+	if (dev->netdev_ops && dev->netdev_ops->ndo_do_ioctl)
+		return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
+	return -EOPNOTSUPP;
+}
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
 /*
  * BQL was added as of v3.3 but some Linux distributions
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index e85db3a..49bcc6f 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -12,6 +12,73 @@ int __must_check pci_enable_device_mem(struct pci_dev *dev);
 	const struct pci_device_id _table[] __devinitdata
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+#define compat_pci_suspend(fn)						\
+	int fn##_compat(struct pci_dev *pdev, pm_message_t state) 	\
+	{								\
+		int r;							\
+									\
+		r = fn(&pdev->dev);					\
+		if (r)							\
+			return r;					\
+									\
+		pci_save_state(pdev);					\
+		pci_disable_device(pdev);				\
+		pci_set_power_state(pdev, PCI_D3hot);			\
+									\
+		return 0;						\
+	}
+
+#define compat_pci_resume(fn)						\
+	int fn##_compat(struct pci_dev *pdev)				\
+	{								\
+		int r;							\
+									\
+		pci_set_power_state(pdev, PCI_D0);			\
+		r = pci_enable_device(pdev);				\
+		if (r)							\
+			return r;					\
+		pci_restore_state(pdev);				\
+									\
+		return fn(&pdev->dev);					\
+	}
+#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,29)
+#define compat_pci_suspend(fn)						\
+	int fn##_compat(struct device *dev)			 	\
+	{								\
+		struct pci_dev *pdev = to_pci_dev(dev);			\
+		int r;							\
+									\
+		r = fn(&pdev->dev);					\
+		if (r)							\
+			return r;					\
+									\
+		pci_save_state(pdev);					\
+		pci_disable_device(pdev);				\
+		pci_set_power_state(pdev, PCI_D3hot);			\
+									\
+		return 0;						\
+	}
+
+#define compat_pci_resume(fn)						\
+	int fn##_compat(struct device *dev)				\
+	{								\
+		struct pci_dev *pdev = to_pci_dev(dev);			\
+		int r;							\
+									\
+		pci_set_power_state(pdev, PCI_D0);			\
+		r = pci_enable_device(pdev);				\
+		if (r)							\
+			return r;					\
+		pci_restore_state(pdev);				\
+									\
+		return fn(&pdev->dev);					\
+	}
+#else
+#define compat_pci_suspend(fn)
+#define compat_pci_resume(fn)
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
 /**
  * module_pci_driver() - Helper macro for registering a PCI driver
diff --git a/backport/backport-include/linux/pci_regs.h b/backport/backport-include/linux/pci_regs.h
index f7bfd9a..2591a14 100644
--- a/backport/backport-include/linux/pci_regs.h
+++ b/backport/backport-include/linux/pci_regs.h
@@ -103,4 +103,12 @@
 #define PCI_EXP_SLTCTL2			56      /* Slot Control 2 */
 #endif
 
+#ifndef PCI_EXP_LNKCTL_ES
+#define PCI_EXP_LNKCTL_ES     0x0080  /* Extended Synch */
+#endif
+
+#ifndef PCI_EXP_SLTSTA_PDS
+#define PCI_EXP_SLTSTA_PDS	0x0040  /* Presence Detect State */
+#endif
+
 #endif /* __BACKPORT_UAPI_PCI_REGS_H */
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index cc145a6..007d21d 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -122,4 +122,19 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
 	for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+static inline bool skb_queue_is_first(const struct sk_buff_head *list,
+				      const struct sk_buff *skb)
+{
+	return (skb->prev == (struct sk_buff *) list);
+}
+
+static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list,
+					     const struct sk_buff *skb)
+{
+	BUG_ON(skb_queue_is_first(list, skb));
+	return skb->prev;
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/types.h b/backport/backport-include/linux/types.h
index b787df6..504a615 100644
--- a/backport/backport-include/linux/types.h
+++ b/backport/backport-include/linux/types.h
@@ -32,4 +32,30 @@ typedef u32 phys_addr_t;
 
 #endif /* < 2.6.28 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) && \
+	(defined(CONFIG_ALPHA) || defined(CONFIG_AVR32) || \
+	 defined(CONFIG_BLACKFIN) || defined(CONFIG_CRIS) || \
+	 defined(CONFIG_H8300) || defined(CONFIG_IA64) || \
+	 defined(CONFIG_M68K) ||  defined(CONFIG_MIPS) || \
+	 defined(CONFIG_PARISC) || defined(CONFIG_S390) || \
+	 defined(CONFIG_PPC64) || defined(CONFIG_PPC32) || \
+	 defined(CONFIG_SUPERH) || defined(CONFIG_SPARC) || \
+	 defined(CONFIG_FRV) || defined(CONFIG_X86) || \
+	 defined(CONFIG_M32R) || defined(CONFIG_M68K) || \
+	 defined(CONFIG_MN10300) || defined(CONFIG_XTENSA) || \
+	 defined(CONFIG_ARM))
+#include <asm/atomic.h>
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+typedef struct {
+	volatile int counter;
+} atomic_t;
+
+#ifdef CONFIG_64BIT
+typedef struct {
+	volatile long counter;
+} atomic64_t;
+#endif /* CONFIG_64BIT */
+
+#endif
+
 #endif /* __BACKPORT_TYPES_H */
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index 4ed9617..e155d72 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -97,4 +97,19 @@ static inline void usb_autopm_put_interface_no_suspend(struct usb_interface *int
 #define USB_SUBCLASS_VENDOR_SPEC	0xff
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+static inline void usb_autopm_put_interface_async(struct usb_interface *intf)
+{ }
+static inline int usb_autopm_get_interface_async(struct usb_interface *intf)
+{ return 0; }
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
+#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
+#define usb_unpoison_anchored_urbs LINUX_BACKPORT(usb_unpoison_anchored_urbs)
+extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
+#endif /* CONFIG_USB */
+#endif /* 2.6.23 - 2.6.28 */
+
 #endif /* __BACKPORT_USB_H */
diff --git a/backport/backport-include/net/net_namespace.h b/backport/backport-include/net/net_namespace.h
index 0f74944..edd02ff 100644
--- a/backport/backport-include/net/net_namespace.h
+++ b/backport/backport-include/net/net_namespace.h
@@ -7,4 +7,22 @@
 #include_next <net/net_namespace.h>
 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+#ifdef CONFIG_NET_NS
+static inline void write_pnet(struct net **pnet, struct net *net)
+{
+	*pnet = net;
+}
+
+static inline struct net *read_pnet(struct net * const *pnet)
+{
+	return *pnet;
+}
+
+#else
+#define write_pnet(pnet, net)	do { (void)(net);} while (0)
+#define read_pnet(pnet)		(&init_net)
+#endif
+#endif /* < 2.6.29 */
+
 #endif	/* _COMPAT_NET_NET_NAMESPACE_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 32/42] backports: dissolve compat-2.6.28.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (30 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 31/42] backports: dissolve compat-2.6.29.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 33/42] backports: dissolve compat-2.6.27.h Johannes Berg
                   ` (12 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/asm-generic/bug.h       |  12 +
 backport/backport-include/linux/compat-2.6.28.h   | 286 ----------------------
 backport/backport-include/linux/cpumask.h         |  10 +
 backport/backport-include/linux/hid.h             |  10 +
 backport/backport-include/linux/if_ether.h        |   4 +
 backport/backport-include/linux/interrupt.h       |   1 +
 backport/backport-include/linux/mod_devicetable.h |  14 ++
 backport/backport-include/linux/pci.h             |   8 +
 backport/backport-include/linux/pci_regs.h        |  10 +
 backport/backport-include/linux/platform_device.h |   6 +
 backport/backport-include/linux/printk.h          |   4 +
 backport/backport-include/linux/skbuff.h          |  80 ++++++
 backport/backport-include/linux/timer.h           |  10 +
 backport/backport-include/linux/tty.h             |   6 +
 backport/backport-include/linux/usb.h             |  10 +
 backport/backport-include/linux/wait.h            |   5 +
 backport/backport-include/linux/workqueue.h       |   4 +
 backport/backport-include/pcmcia/ds.h             |  18 ++
 18 files changed, 212 insertions(+), 286 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-2.6.28.h
 create mode 100644 backport/backport-include/linux/cpumask.h
 create mode 100644 backport/backport-include/linux/timer.h

diff --git a/backport/backport-include/asm-generic/bug.h b/backport/backport-include/asm-generic/bug.h
index 86d683c..52d74d3 100644
--- a/backport/backport-include/asm-generic/bug.h
+++ b/backport/backport-include/asm-generic/bug.h
@@ -6,4 +6,16 @@
 #define __WARN(foo) dump_stack()
 #endif
 
+#ifndef WARN_ONCE
+#define WARN_ONCE(condition, format...) ({                      \
+	static int __warned;                                    \
+	int __ret_warn_once = !!(condition);                    \
+								\
+	if (unlikely(__ret_warn_once))                          \
+		if (WARN(!__warned, format))                    \
+			__warned = 1;                           \
+	unlikely(__ret_warn_once);                              \
+})
+#endif
+
 #endif /* __BACKPORT_ASM_GENERIC_BUG_H */
diff --git a/backport/backport-include/linux/compat-2.6.28.h b/backport/backport-include/linux/compat-2.6.28.h
deleted file mode 100644
index 12b644f..0000000
--- a/backport/backport-include/linux/compat-2.6.28.h
+++ /dev/null
@@ -1,286 +0,0 @@
-#ifndef LINUX_26_28_COMPAT_H
-#define LINUX_26_28_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
-
-#include <linux/skbuff.h>
-#include <linux/if_ether.h>
-#include <linux/usb.h>
-#include <linux/types.h>
-#include <linux/types.h>
-#include <linux/cpumask.h>
-#include <linux/mod_devicetable.h>
-#include <linux/input.h>
-
-#define HID_ANY_ID                             (~0)
-
-#define HID_USB_DEVICE(ven, prod)                              \
-	.bus = BUS_USB, .vendor = (ven), .product = (prod)
-#define HID_BLUETOOTH_DEVICE(ven, prod)                                        \
-	.bus = BUS_BLUETOOTH, .vendor = (ven), .product = (prod)
-
-
-struct hid_device_id {
-	__u16 bus;
-	__u32 vendor;
-	__u32 product;
-	kernel_ulong_t driver_data
-		__attribute__((aligned(sizeof(kernel_ulong_t))));
-};
-
-#ifndef ETH_P_PAE
-#define ETH_P_PAE 0x888E      /* Port Access Entity (IEEE 802.1X) */
-#endif
-
-#include <linux/pci.h>
-#include <linux/pci_regs.h>
-#include <linux/platform_device.h>
-
-#define platform_device_register_data LINUX_BACKPORT(platform_device_register_data)
-extern struct platform_device *platform_device_register_data(struct device *,
-		const char *, int, const void *, size_t);
-
-typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } compat_cpumask_t;
-
-#ifndef WARN_ONCE
-#define WARN_ONCE(condition, format...) ({                      \
-	static int __warned;                                    \
-	int __ret_warn_once = !!(condition);                    \
-								\
-	if (unlikely(__ret_warn_once))                          \
-		if (WARN(!__warned, format))                    \
-			__warned = 1;                           \
-	unlikely(__ret_warn_once);                              \
-})
-#endif /* From include/asm-generic/bug.h */
-
-#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
-
-#include <pcmcia/cs_types.h>
-#include <pcmcia/cs.h>
-#include <pcmcia/cistpl.h>
-#ifdef pcmcia_parse_tuple
-#undef pcmcia_parse_tuple
-#define pcmcia_parse_tuple(tuple, parse) pccard_parse_tuple(tuple, parse)
-#endif
-
-/* From : include/pcmcia/ds.h */
-/* loop CIS entries for valid configuration */
-#define pcmcia_loop_config LINUX_BACKPORT(pcmcia_loop_config)
-int pcmcia_loop_config(struct pcmcia_device *p_dev,
-		       int	(*conf_check)	(struct pcmcia_device *p_dev,
-						 cistpl_cftable_entry_t *cfg,
-						 cistpl_cftable_entry_t *dflt,
-						 unsigned int vcc,
-						 void *priv_data),
-		       void *priv_data);
-
-#endif /* CONFIG_PCMCIA */
-
-/* USB anchors were added as of 2.6.23 */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
-
-#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
-#if 0
-#define usb_poison_urb LINUX_BACKPORT(usb_poison_urb)
-extern void usb_poison_urb(struct urb *urb);
-#endif
-#define usb_unpoison_urb LINUX_BACKPORT(usb_unpoison_urb)
-extern void usb_unpoison_urb(struct urb *urb);
-
-#if 0
-#define usb_poison_anchored_urbs LINUX_BACKPORT(usb_poison_anchored_urbs)
-extern void usb_poison_anchored_urbs(struct usb_anchor *anchor);
-#endif
-
-#define usb_anchor_empty LINUX_BACKPORT(usb_anchor_empty)
-extern int usb_anchor_empty(struct usb_anchor *anchor);
-#endif /* CONFIG_USB */
-#endif
-
-
-#define pci_ioremap_bar LINUX_BACKPORT(pci_ioremap_bar)
-void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
-
-/**
- *	skb_queue_is_last - check if skb is the last entry in the queue
- *	@list: queue head
- *	@skb: buffer
- *
- *	Returns true if @skb is the last buffer on the list.
- */
-static inline bool skb_queue_is_last(const struct sk_buff_head *list,
-				     const struct sk_buff *skb)
-{
-	return (skb->next == (struct sk_buff *) list);
-}
-
-/**
- *	skb_queue_next - return the next packet in the queue
- *	@list: queue head
- *	@skb: current buffer
- *
- *	Return the next packet in @list after @skb.  It is only valid to
- *	call this if skb_queue_is_last() evaluates to false.
- */
-static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list,
-                                             const struct sk_buff *skb)
-{
-	/* This BUG_ON may seem severe, but if we just return then we
-	 * are going to dereference garbage.
-	 */
-	BUG_ON(skb_queue_is_last(list, skb));
-	return skb->next;
-}
-
-/**
- *	__skb_queue_head_init - initialize non-spinlock portions of sk_buff_head
- *	@list: queue to initialize
- *
- *	This initializes only the list and queue length aspects of
- *	an sk_buff_head object.  This allows to initialize the list
- *	aspects of an sk_buff_head without reinitializing things like
- *	the spinlock.  It can also be used for on-stack sk_buff_head
- *	objects where the spinlock is known to not be used.
- */
-static inline void __skb_queue_head_init(struct sk_buff_head *list)
-{
-	list->prev = list->next = (struct sk_buff *)list;
-	list->qlen = 0;
-}
-
-static inline void __skb_queue_splice(const struct sk_buff_head *list,
-				      struct sk_buff *prev,
-				      struct sk_buff *next)
-{
-	struct sk_buff *first = list->next;
-	struct sk_buff *last = list->prev;
-
-	first->prev = prev;
-	prev->next = first;
-
-	last->next = next;
-	next->prev = last;
-}
-
-/**
- *	skb_queue_splice - join two skb lists, this is designed for stacks
- *	@list: the new list to add
- *	@head: the place to add it in the first list
- */
-static inline void skb_queue_splice(const struct sk_buff_head *list,
-				    struct sk_buff_head *head)
-{
-	if (!skb_queue_empty(list)) {
-		__skb_queue_splice(list, (struct sk_buff *) head, head->next);
-		head->qlen += list->qlen;
-	}
-}
-
-/**
- *	skb_queue_splice - join two skb lists and reinitialise the emptied list
- *	@list: the new list to add
- *	@head: the place to add it in the first list
- *
- *	The list at @list is reinitialised
- */
-static inline void skb_queue_splice_init(struct sk_buff_head *list,
-					 struct sk_buff_head *head)
-{
-	if (!skb_queue_empty(list)) {
-		__skb_queue_splice(list, (struct sk_buff *) head, head->next);
-		head->qlen += list->qlen;
-		__skb_queue_head_init(list);
-	}
-}
-
-/**
- *	skb_queue_splice_tail - join two skb lists and reinitialise the emptied list
- *	@list: the new list to add
- *	@head: the place to add it in the first list
- *
- *	Each of the lists is a queue.
- *	The list at @list is reinitialised
- */
-static inline void skb_queue_splice_tail_init(struct sk_buff_head *list,
-					      struct sk_buff_head *head)
-{
-	if (!skb_queue_empty(list)) {
-		__skb_queue_splice(list, head->prev, (struct sk_buff *) head);
-		head->qlen += list->qlen;
-		__skb_queue_head_init(list);
-	}
-} /* From include/linux/skbuff.h */
-
-/**
- *	skb_queue_splice_tail - join two skb lists, each list being a queue
- *	@list: the new list to add
- *	@head: the place to add it in the first list
- */
-static inline void skb_queue_splice_tail(const struct sk_buff_head *list,
-					 struct sk_buff_head *head)
-{
-	if (!skb_queue_empty(list)) {
-		__skb_queue_splice(list, head->prev, (struct sk_buff *) head);
-		head->qlen += list->qlen;
-	}
-}
-
-#define skb_queue_walk_from(queue, skb)						\
-		for (; skb != (struct sk_buff *)(queue);			\
-		     skb = skb->next)
-
-#ifndef DECLARE_TRACE
-
-#define TP_PROTO(args...)	args
-#define TP_ARGS(args...)		args
-
-#define DECLARE_TRACE(name, proto, args)				\
-	static inline void _do_trace_##name(struct tracepoint *tp, proto) \
-	{ }								\
-	static inline void trace_##name(proto)				\
-	{ }								\
-	static inline int register_trace_##name(void (*probe)(proto))	\
-	{								\
-		return -ENOSYS;						\
-	}								\
-	static inline int unregister_trace_##name(void (*probe)(proto))	\
-	{								\
-		return -ENOSYS;						\
-	}
-
-#define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
-#define EXPORT_TRACEPOINT_SYMBOL(name)
-
-
-#endif
-
-#define round_jiffies_up LINUX_BACKPORT(round_jiffies_up)
-unsigned long round_jiffies_up(unsigned long j);
-
-#define wake_up_interruptible_poll(x, m)			\
-	__wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m))
-
-#define n_tty_ioctl_helper LINUX_BACKPORT(n_tty_ioctl_helper)
-extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
-		       unsigned int cmd, unsigned long arg);
-
-#define pci_wake_from_d3 LINUX_BACKPORT(pci_wake_from_d3)
-int pci_wake_from_d3(struct pci_dev *dev, bool enable);
-
-#define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active)
-
-#ifndef pr_fmt
-#define pr_fmt(fmt) fmt
-#endif
-
-#define PCI_EXP_DEVCAP2		36      /* Device Capabilities 2 */
-#define  PCI_EXP_DEVCAP2_ARI  	0x20    /* Alternative Routing-ID */
-#define PCI_EXP_DEVCTL2		40      /* Device Control 2 */
-#define  PCI_EXP_DEVCTL2_ARI	0x20    /* Alternative Routing-ID */
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)) */
-
-#endif /* LINUX_26_28_COMPAT_H */
diff --git a/backport/backport-include/linux/cpumask.h b/backport/backport-include/linux/cpumask.h
new file mode 100644
index 0000000..7df3457
--- /dev/null
+++ b/backport/backport-include/linux/cpumask.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_LINUX_CPUMASK_H
+#define __BACKPORT_LINUX_CPUMASK_H
+#include_next <linux/cpumask.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } compat_cpumask_t;
+#endif
+
+#endif /* __BACKPORT_LINUX_CPUMASK_H */
diff --git a/backport/backport-include/linux/hid.h b/backport/backport-include/linux/hid.h
index 4ad740a..22ff6f1 100644
--- a/backport/backport-include/linux/hid.h
+++ b/backport/backport-include/linux/hid.h
@@ -24,4 +24,14 @@ extern bool hid_ignore(struct hid_device *);
 #define HID_QUIRK_IGNORE                       0x00000004
 #endif
 
+#ifndef HID_USB_DEVICE
+#define HID_USB_DEVICE(ven, prod)                              \
+	.bus = BUS_USB, .vendor = (ven), .product = (prod)
+#endif
+
+#ifndef HID_BLUETOOTH_DEVICE
+#define HID_BLUETOOTH_DEVICE(ven, prod)                                        \
+	.bus = BUS_BLUETOOTH, .vendor = (ven), .product = (prod)
+#endif
+
 #endif /* __BACKPORT_HID_H */
diff --git a/backport/backport-include/linux/if_ether.h b/backport/backport-include/linux/if_ether.h
index dd1bae4..8581283 100644
--- a/backport/backport-include/linux/if_ether.h
+++ b/backport/backport-include/linux/if_ether.h
@@ -27,4 +27,8 @@
 int mac_pton(const char *s, u8 *mac);
 #endif
 
+#ifndef ETH_P_PAE
+#define ETH_P_PAE 0x888E      /* Port Access Entity (IEEE 802.1X) */
+#endif
+
 #endif /* __BACKPORT_IF_ETHER_H */
diff --git a/backport/backport-include/linux/interrupt.h b/backport/backport-include/linux/interrupt.h
index 9e51303..1729567 100644
--- a/backport/backport-include/linux/interrupt.h
+++ b/backport/backport-include/linux/interrupt.h
@@ -11,6 +11,7 @@ static inline int irq_set_irq_wake(unsigned int irq, unsigned int on)
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#include <linux/cpumask.h>
 /* mask irq_set_affinity_hint as RHEL6 backports this */
 #define irq_set_affinity_hint LINUX_BACKPORT(irq_set_affinity_hint)
 /*
diff --git a/backport/backport-include/linux/mod_devicetable.h b/backport/backport-include/linux/mod_devicetable.h
index 59321af..1f85ce6 100644
--- a/backport/backport-include/linux/mod_devicetable.h
+++ b/backport/backport-include/linux/mod_devicetable.h
@@ -10,6 +10,20 @@
 #define HID_GROUP_ANY                          0x0000
 #endif
 
+#ifndef HID_ANY_ID
+#define HID_ANY_ID                             (~0)
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+struct hid_device_id {
+	__u16 bus;
+	__u32 vendor;
+	__u32 product;
+	kernel_ulong_t driver_data
+		__attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
 #ifndef BCMA_CORE
 /* Broadcom's specific AMBA core, see drivers/bcma/ */
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index 49bcc6f..94199bb 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -165,4 +165,12 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
 }
 #endif /* < 2.6.33 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+#define pci_ioremap_bar LINUX_BACKPORT(pci_ioremap_bar)
+void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
+
+#define pci_wake_from_d3 LINUX_BACKPORT(pci_wake_from_d3)
+int pci_wake_from_d3(struct pci_dev *dev, bool enable);
+#endif
+
 #endif /* _BACKPORT_LINUX_PCI_H */
diff --git a/backport/backport-include/linux/pci_regs.h b/backport/backport-include/linux/pci_regs.h
index 2591a14..401875f 100644
--- a/backport/backport-include/linux/pci_regs.h
+++ b/backport/backport-include/linux/pci_regs.h
@@ -111,4 +111,14 @@
 #define PCI_EXP_SLTSTA_PDS	0x0040  /* Presence Detect State */
 #endif
 
+#ifndef PCI_EXP_DEVCAP2
+#define PCI_EXP_DEVCAP2		36      /* Device Capabilities 2 */
+#define  PCI_EXP_DEVCAP2_ARI  	0x20    /* Alternative Routing-ID */
+#endif
+
+#ifndef PCI_EXP_DEVCTL2
+#define PCI_EXP_DEVCTL2		40      /* Device Control 2 */
+#define  PCI_EXP_DEVCTL2_ARI	0x20    /* Alternative Routing-ID */
+#endif
+
 #endif /* __BACKPORT_UAPI_PCI_REGS_H */
diff --git a/backport/backport-include/linux/platform_device.h b/backport/backport-include/linux/platform_device.h
index d7a34a9..d93f04b 100644
--- a/backport/backport-include/linux/platform_device.h
+++ b/backport/backport-include/linux/platform_device.h
@@ -33,4 +33,10 @@ module_exit(__platform_driver##_exit);
                         platform_driver_unregister)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+#define platform_device_register_data LINUX_BACKPORT(platform_device_register_data)
+extern struct platform_device *platform_device_register_data(struct device *,
+		const char *, int, const void *, size_t);
+#endif
+
 #endif /* __BACKPORT_PLATFORM_DEVICE_H */
diff --git a/backport/backport-include/linux/printk.h b/backport/backport-include/linux/printk.h
index b97f51e..00d86f3 100644
--- a/backport/backport-include/linux/printk.h
+++ b/backport/backport-include/linux/printk.h
@@ -9,6 +9,10 @@
 #include <linux/kernel.h>
 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35)) */
 
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
 /* backports 7a555613 */
 #if defined(CONFIG_DYNAMIC_DEBUG)
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 007d21d..d34378e 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -137,4 +137,84 @@ static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list,
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+static inline bool skb_queue_is_last(const struct sk_buff_head *list,
+				     const struct sk_buff *skb)
+{
+	return (skb->next == (struct sk_buff *) list);
+}
+
+static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list,
+                                             const struct sk_buff *skb)
+{
+	/* This BUG_ON may seem severe, but if we just return then we
+	 * are going to dereference garbage.
+	 */
+	BUG_ON(skb_queue_is_last(list, skb));
+	return skb->next;
+}
+
+static inline void __skb_queue_head_init(struct sk_buff_head *list)
+{
+	list->prev = list->next = (struct sk_buff *)list;
+	list->qlen = 0;
+}
+
+static inline void __skb_queue_splice(const struct sk_buff_head *list,
+				      struct sk_buff *prev,
+				      struct sk_buff *next)
+{
+	struct sk_buff *first = list->next;
+	struct sk_buff *last = list->prev;
+
+	first->prev = prev;
+	prev->next = first;
+
+	last->next = next;
+	next->prev = last;
+}
+
+static inline void skb_queue_splice(const struct sk_buff_head *list,
+				    struct sk_buff_head *head)
+{
+	if (!skb_queue_empty(list)) {
+		__skb_queue_splice(list, (struct sk_buff *) head, head->next);
+		head->qlen += list->qlen;
+	}
+}
+
+static inline void skb_queue_splice_init(struct sk_buff_head *list,
+					 struct sk_buff_head *head)
+{
+	if (!skb_queue_empty(list)) {
+		__skb_queue_splice(list, (struct sk_buff *) head, head->next);
+		head->qlen += list->qlen;
+		__skb_queue_head_init(list);
+	}
+}
+
+static inline void skb_queue_splice_tail_init(struct sk_buff_head *list,
+					      struct sk_buff_head *head)
+{
+	if (!skb_queue_empty(list)) {
+		__skb_queue_splice(list, head->prev, (struct sk_buff *) head);
+		head->qlen += list->qlen;
+		__skb_queue_head_init(list);
+	}
+}
+
+static inline void skb_queue_splice_tail(const struct sk_buff_head *list,
+					 struct sk_buff_head *head)
+{
+	if (!skb_queue_empty(list)) {
+		__skb_queue_splice(list, head->prev, (struct sk_buff *) head);
+		head->qlen += list->qlen;
+	}
+}
+
+#define skb_queue_walk_from(queue, skb)						\
+		for (; skb != (struct sk_buff *)(queue);			\
+		     skb = skb->next)
+#endif /* < 2.6.28 */
+
 #endif /* __BACKPORT_SKBUFF_H */
diff --git a/backport/backport-include/linux/timer.h b/backport/backport-include/linux/timer.h
new file mode 100644
index 0000000..2720584
--- /dev/null
+++ b/backport/backport-include/linux/timer.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_LINUX_TIMER_H
+#define __BACKPORT_LINUX_TIMER_H
+#include_next <linux/timer.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+#define round_jiffies_up LINUX_BACKPORT(round_jiffies_up)
+unsigned long round_jiffies_up(unsigned long j);
+#endif
+
+#endif /* __BACKPORT_LINUX_TIMER_H */
diff --git a/backport/backport-include/linux/tty.h b/backport/backport-include/linux/tty.h
index 4a5a733..b102645 100644
--- a/backport/backport-include/linux/tty.h
+++ b/backport/backport-include/linux/tty.h
@@ -33,6 +33,12 @@ static inline void tty_unlock(void) __releases(kernel_lock)
 #define tty_locked()           (kernel_locked())
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+#define n_tty_ioctl_helper LINUX_BACKPORT(n_tty_ioctl_helper)
+extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
+		       unsigned int cmd, unsigned long arg);
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
 /* Backports tty_lock: Localise the lock */
 #define tty_lock(__tty) tty_lock()
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index e155d72..3821575 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -112,4 +112,14 @@ extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
 #endif /* CONFIG_USB */
 #endif /* 2.6.23 - 2.6.28 */
 
+/* USB anchors were added as of 2.6.23 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
+#define usb_unpoison_urb LINUX_BACKPORT(usb_unpoison_urb)
+extern void usb_unpoison_urb(struct urb *urb);
+
+#define usb_anchor_empty LINUX_BACKPORT(usb_anchor_empty)
+extern int usb_anchor_empty(struct usb_anchor *anchor);
+#endif /* 2.6.23-2.6.27 */
+
 #endif /* __BACKPORT_USB_H */
diff --git a/backport/backport-include/linux/wait.h b/backport/backport-include/linux/wait.h
index 9549984..7ada8bc 100644
--- a/backport/backport-include/linux/wait.h
+++ b/backport/backport-include/linux/wait.h
@@ -16,4 +16,9 @@ extern void compat_wake_up_locked(wait_queue_head_t *q, unsigned int mode, int n
 #define wake_up_all_locked(x)	compat_wake_up_locked((x), TASK_NORMAL, 0)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+#define wake_up_interruptible_poll(x, m)			\
+	__wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m))
+#endif
+
 #endif /* __BACKPORT_LINUX_WAIT_H */
diff --git a/backport/backport-include/linux/workqueue.h b/backport/backport-include/linux/workqueue.h
index 0caaf05..3a035de 100644
--- a/backport/backport-include/linux/workqueue.h
+++ b/backport/backport-include/linux/workqueue.h
@@ -18,6 +18,10 @@ bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
 #define alloc_ordered_workqueue(name, flags) create_singlethread_workqueue(name)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+#define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active)
+#endif
+
 #ifndef alloc_workqueue
 #define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active, 0)
 #endif
diff --git a/backport/backport-include/pcmcia/ds.h b/backport/backport-include/pcmcia/ds.h
index 5cc2e60..0e317cd 100644
--- a/backport/backport-include/pcmcia/ds.h
+++ b/backport/backport-include/pcmcia/ds.h
@@ -66,4 +66,22 @@ int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
 					 void *priv_data));
 #endif /* < 2.6.33 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+#ifdef pcmcia_parse_tuple
+#undef pcmcia_parse_tuple
+#define pcmcia_parse_tuple(tuple, parse) pccard_parse_tuple(tuple, parse)
+#endif
+
+/* From : include/pcmcia/ds.h */
+/* loop CIS entries for valid configuration */
+#define pcmcia_loop_config LINUX_BACKPORT(pcmcia_loop_config)
+int pcmcia_loop_config(struct pcmcia_device *p_dev,
+		       int	(*conf_check)	(struct pcmcia_device *p_dev,
+						 cistpl_cftable_entry_t *cfg,
+						 cistpl_cftable_entry_t *dflt,
+						 unsigned int vcc,
+						 void *priv_data),
+		       void *priv_data);
+#endif
+
 #endif /* __BACKPORT_PCMCIA_DS_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 33/42] backports: dissolve compat-2.6.27.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (31 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 32/42] backports: dissolve compat-2.6.28.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 34/42] backports: dissolve compat-2.6.26.h Johannes Berg
                   ` (11 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/asm-generic/bug.h        |  18 ++
 .../backport-include/asm-generic/pci-dma-compat.h  |  17 ++
 backport/backport-include/linux/compat-2.6.27.h    | 317 ---------------------
 backport/backport-include/linux/debugfs.h          |  18 ++
 backport/backport-include/linux/device.h           |  12 +
 backport/backport-include/linux/dma-mapping.h      |  43 +++
 backport/backport-include/linux/ethtool.h          |  13 +
 backport/backport-include/linux/firmware.h         |   8 +
 backport/backport-include/linux/kernel.h           |   4 +
 backport/backport-include/linux/list.h             |  58 ++++
 backport/backport-include/linux/lockdep.h          |  23 ++
 backport/backport-include/linux/mmc/core.h         |  12 +
 backport/backport-include/linux/mmc/sdio_func.h    |   6 +
 backport/backport-include/linux/netdevice.h        |  30 ++
 backport/backport-include/linux/pci.h              |   5 +
 backport/backport-include/linux/pci_regs.h         |   4 +
 backport/backport-include/linux/workqueue.h        |   5 +
 backport/backport-include/net/iw_handler.h         |  17 ++
 backport/backport-include/net/sch_generic.h        |  38 +++
 19 files changed, 331 insertions(+), 317 deletions(-)
 create mode 100644 backport/backport-include/asm-generic/pci-dma-compat.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.27.h
 create mode 100644 backport/backport-include/linux/debugfs.h
 create mode 100644 backport/backport-include/linux/mmc/core.h

diff --git a/backport/backport-include/asm-generic/bug.h b/backport/backport-include/asm-generic/bug.h
index 52d74d3..4e9e05f 100644
--- a/backport/backport-include/asm-generic/bug.h
+++ b/backport/backport-include/asm-generic/bug.h
@@ -18,4 +18,22 @@
 })
 #endif
 
+#ifndef __WARN_printf
+/*
+ * To port this properly we'd have to port warn_slowpath_null(),
+ * which I'm lazy to do so just do a regular print for now. If you
+ * want to port this read kernel/panic.c
+ */
+#define __WARN_printf(arg...)   do { printk(arg); __WARN(); } while (0)
+#endif
+
+#ifndef WARN
+#define WARN(condition, format...) ({					\
+	int __ret_warn_on = !!(condition);				\
+	if (unlikely(__ret_warn_on))					\
+		__WARN_printf(format);					\
+	unlikely(__ret_warn_on);					\
+})
+#endif
+
 #endif /* __BACKPORT_ASM_GENERIC_BUG_H */
diff --git a/backport/backport-include/asm-generic/pci-dma-compat.h b/backport/backport-include/asm-generic/pci-dma-compat.h
new file mode 100644
index 0000000..aa61f4d
--- /dev/null
+++ b/backport/backport-include/asm-generic/pci-dma-compat.h
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_ASM_PCI_DMA_COMPAT_H
+#define __BACKPORT_ASM_PCI_DMA_COMPAT_H
+#include_next <asm-generic/pci-dma-compat.h>
+#include <linux/version.h>
+
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#include <backport/magic.h>
+
+#define pci_dma_mapping_error1(dma_addr) dma_mapping_error1(dma_addr)
+#define pci_dma_mapping_error2(pdev, dma_addr) dma_mapping_error2(pdev, dma_addr)
+#undef pci_dma_mapping_error
+#define pci_dma_mapping_error(...) \
+	macro_dispatcher(pci_dma_mapping_error, __VA_ARGS__)(__VA_ARGS__)
+#endif
+
+#endif /* __BACKPORT_ASM_PCI_DMA_COMPAT_H */
diff --git a/backport/backport-include/linux/compat-2.6.27.h b/backport/backport-include/linux/compat-2.6.27.h
deleted file mode 100644
index b71a3b5..0000000
--- a/backport/backport-include/linux/compat-2.6.27.h
+++ /dev/null
@@ -1,317 +0,0 @@
-#ifndef LINUX_26_27_COMPAT_H
-#define LINUX_26_27_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
-
-#include <linux/debugfs.h>
-#include <linux/list.h>
-#include <linux/pci.h>
-#include <linux/dma-mapping.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
-#include <linux/mmc/sdio.h>
-#include <linux/mmc/sdio_func.h>
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) */
-#include <linux/netdevice.h>
-#include <linux/workqueue.h>
-#include <net/iw_handler.h>
-#include <asm-generic/bug.h>
-#include <linux/wireless.h>
-#include <linux/skbuff.h>
-#include <net/sch_generic.h>
-#include <linux/ethtool.h>
-
-static inline struct net_device *qdisc_dev(const struct Qdisc *qdisc)
-{
-	return qdisc->dev;
-}
-
-/*
- * Backports 378a2f09 and c27f339a
- * This may need a bit more work.
- */
-enum net_xmit_qdisc_t {
-	__NET_XMIT_STOLEN = 0x00010000,
-	__NET_XMIT_BYPASS = 0x00020000,
-};
-
-struct qdisc_skb_cb {
-	unsigned int            pkt_len;
-	char                    data[];
-};
-
-static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb)
-{
-	return (struct qdisc_skb_cb *)skb->cb;
-}
-
-static inline unsigned int qdisc_pkt_len(struct sk_buff *skb)
-{
-	return qdisc_skb_cb(skb)->pkt_len;
-}
-
-#define PCI_PM_CAP_PME_SHIFT	11
-
-/* I can't find a more suitable replacement... */
-#define flush_work(work) cancel_work_sync(work)
-
-struct builtin_fw {
-	char *name;
-	void *data;
-	unsigned long size;
-};
-
-/*
- * On older kernels we do not have net_device Multi Queue support, but
- * since we no longer use MQ on mac80211 we can simply use the 0 queue.
- * Note that if other fullmac drivers make use of this they then need
- * to be backported somehow or deal with just 1 queueue from MQ.
- */
-static inline void netif_tx_wake_all_queues(struct net_device *dev)
-{
-	netif_wake_queue(dev);
-}
-static inline void netif_tx_start_all_queues(struct net_device *dev)
-{
-	netif_start_queue(dev);
-}
-static inline void netif_tx_stop_all_queues(struct net_device *dev)
-{
-	netif_stop_queue(dev);
-}
-
-/* Are all TX queues of the device empty?  */
-static inline bool qdisc_all_tx_empty(const struct net_device *dev)
-{
-	return skb_queue_empty(&dev->qdisc->q);
-}
-
-#define pci_pme_capable LINUX_BACKPORT(pci_pme_capable)
-bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
-
-/*
- * The net_device has a spin_lock on newer kernels, on older kernels we're out of luck
- */
-#define netif_addr_lock_bh(dev)
-#define netif_addr_unlock_bh(dev)
-
-/*
- * To port this properly we'd have to port warn_slowpath_null(),
- * which I'm lazy to do so just do a regular print for now. If you
- * want to port this read kernel/panic.c
- */
-#define __WARN_printf(arg...)   do { printk(arg); __WARN(); } while (0)
-
-/* This is ported directly as-is on newer kernels */
-#ifndef WARN
-#define WARN(condition, format...) ({					\
-	int __ret_warn_on = !!(condition);				\
-	if (unlikely(__ret_warn_on))					\
-		__WARN_printf(format);					\
-	unlikely(__ret_warn_on);					\
-})
-#endif
-
-/* On 2.6.27 a second argument was added, on older kernels we ignore it */
-#define dma_mapping_error(pdev, dma_addr) dma_mapping_error(dma_addr)
-#define pci_dma_mapping_error(pdev, dma_addr) dma_mapping_error(pdev, dma_addr)
-
-/* This is from include/linux/ieee80211.h */
-#define IEEE80211_HT_CAP_DSSSCCK40		0x1000
-
-/* New link list changes added as of 2.6.27, needed for ath9k */
-
-static inline void __list_cut_position(struct list_head *list,
-		struct list_head *head, struct list_head *entry)
-{
-	struct list_head *new_first = entry->next;
-	list->next = head->next;
-	list->next->prev = list;
-	list->prev = entry;
-	entry->next = list;
-	head->next = new_first;
-	new_first->prev = head;
-}
-
-/**
- * list_cut_position - cut a list into two
- * @list: a new list to add all removed entries
- * @head: a list with entries
- * @entry: an entry within head, could be the head itself
- *	and if so we won't cut the list
- *
- * This helper moves the initial part of @head, up to and
- * including @entry, from @head to @list. You should
- * pass on @entry an element you know is on @head. @list
- * should be an empty list or a list you do not care about
- * losing its data.
- *
- */
-static inline void list_cut_position(struct list_head *list,
-		struct list_head *head, struct list_head *entry)
-{
-	if (list_empty(head))
-		return;
-	if (list_is_singular(head) &&
-		(head->next != entry && head != entry))
-		return;
-	if (entry == head)
-		INIT_LIST_HEAD(list);
-	else
-		__list_cut_position(list, head, entry);
-}
-
-
-/* __list_splice as re-implemented on 2.6.27, we backport it */
-static inline void __compat_list_splice_new_27(const struct list_head *list,
-				 struct list_head *prev,
-				 struct list_head *next)
-{
-	struct list_head *first = list->next;
-	struct list_head *last = list->prev;
-
-	first->prev = prev;
-	prev->next = first;
-
-	last->next = next;
-	next->prev = last;
-}
-
-/**
- * list_splice_tail - join two lists, each list being a queue
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- */
-static inline void list_splice_tail(struct list_head *list,
-				struct list_head *head)
-{
-	if (!list_empty(list))
-		__compat_list_splice_new_27(list, head->prev, head);
-}
-
-/**
- * list_splice_tail_init - join two lists and reinitialise the emptied list
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- *
- * Each of the lists is a queue.
- * The list at @list is reinitialised
- */
-static inline void list_splice_tail_init(struct list_head *list,
-					 struct list_head *head)
-{
-	if (!list_empty(list)) {
-		__compat_list_splice_new_27(list, head->prev, head);
-		INIT_LIST_HEAD(list);
-	}
-}
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
-#define mmc_align_data_size LINUX_BACKPORT(mmc_align_data_size)
-extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
-#define sdio_align_size LINUX_BACKPORT(sdio_align_size)
-extern unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz);
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) */
-
-#define iwe_stream_add_value(info, event, value, ends, iwe, event_len) iwe_stream_add_value(event, value, ends, iwe, event_len)
-#define iwe_stream_add_point(info, stream, ends, iwe, extra) iwe_stream_add_point(stream, ends, iwe, extra)
-#define iwe_stream_add_event(info, stream, ends, iwe, event_len) iwe_stream_add_event(stream, ends, iwe, event_len)
-
-/* Flags available in struct iw_request_info */
-#define IW_REQUEST_FLAG_COMPAT	0x0001	/* Compat ioctl call */
-
-static inline int iwe_stream_lcp_len(struct iw_request_info *info)
-{
-#ifdef CONFIG_COMPAT
-	if (info->flags & IW_REQUEST_FLAG_COMPAT)
-		return IW_EV_COMPAT_LCP_LEN;
-#endif
-	return IW_EV_LCP_LEN;
-}
-
-#ifdef CONFIG_ARM
-
-/*
- * The caller asks to handle a range between offset and offset + size,
- * but we process a larger range from 0 to offset + size due to lack of
- * offset support.
- */
-
-static inline void dma_sync_single_range_for_cpu(struct device *dev,
-		dma_addr_t handle, unsigned long offset, size_t size,
-		enum dma_data_direction dir)
-{
-	dma_sync_single_for_cpu(dev, handle, offset + size, dir);
-}
-
-static inline void dma_sync_single_range_for_device(struct device *dev,
-		dma_addr_t handle, unsigned long offset, size_t size,
-		enum dma_data_direction dir)
-{
-	dma_sync_single_for_device(dev, handle, offset + size, dir);
-}
-
-#endif /* arm */
-
-#define debugfs_remove_recursive LINUX_BACKPORT(debugfs_remove_recursive)
-
-#if defined(CONFIG_DEBUG_FS)
-void debugfs_remove_recursive(struct dentry *dentry);
-#else
-static inline void debugfs_remove_recursive(struct dentry *dentry)
-{ }
-#endif
-
-#define device_create(cls, parent, devt, drvdata, fmt, ...)		\
-({									\
-	struct device *_dev;						\
-	_dev = (device_create)(cls, parent, devt, fmt, __VA_ARGS__);	\
-	dev_set_drvdata(_dev, drvdata);					\
-	_dev;								\
-})
-
-#define dev_name(dev) dev_name((struct device *)dev)
-
-static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
-					 __u32 speed)
-{
-	ep->speed = (__u16)speed;
-}
-
-static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
-{
-	return ep->speed;
-}
-
-/**
- * lower_32_bits - return bits 0-31 of a number
- * @n: the number we're accessing
- */
-#define lower_32_bits(n) ((u32)(n))
-
-#define netif_wake_subqueue netif_start_subqueue
-
-/* Backport of:
- *
- * commit 3295f0ef9ff048a4619ede597ad9ec9cab725654
- * Author: Ingo Molnar <mingo@elte.hu>
- * Date:   Mon Aug 11 10:30:30 2008 +0200
- *
- *     lockdep: rename map_[acquire|release]() => lock_map_[acquire|release]()
- */
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-# ifdef CONFIG_PROVE_LOCKING
-#  define lock_map_acquire(l)		lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_)
-# else
-#  define lock_map_acquire(l)		lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_)
-# endif
-# define lock_map_release(l)			lock_release(l, 1, _THIS_IP_)
-#else
-# define lock_map_acquire(l)			do { } while (0)
-# define lock_map_release(l)			do { } while (0)
-#endif
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) */
-
-#endif /* LINUX_26_27_COMPAT_H */
diff --git a/backport/backport-include/linux/debugfs.h b/backport/backport-include/linux/debugfs.h
new file mode 100644
index 0000000..16604e3
--- /dev/null
+++ b/backport/backport-include/linux/debugfs.h
@@ -0,0 +1,18 @@
+#ifndef __BACKPORT_LINUX_DEBUGFS_H
+#define __BACKPORT_LINUX_DEBUGFS_H
+#include_next <linux/debugfs.h>
+#include <linux/version.h>
+
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#define debugfs_remove_recursive LINUX_BACKPORT(debugfs_remove_recursive)
+
+#if defined(CONFIG_DEBUG_FS)
+void debugfs_remove_recursive(struct dentry *dentry);
+#else
+static inline void debugfs_remove_recursive(struct dentry *dentry)
+{ }
+#endif
+#endif /* < 2.6.27 */
+
+#endif /* __BACKPORT_LINUX_DEBUGFS_H */
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 516cc31..07ebe9f 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -129,4 +129,16 @@ static inline void dev_set_uevent_suppress(struct device *dev, int val)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#define device_create(cls, parent, devt, drvdata, fmt, ...)		\
+({									\
+	struct device *_dev;						\
+	_dev = (device_create)(cls, parent, devt, fmt, __VA_ARGS__);	\
+	dev_set_drvdata(_dev, drvdata);					\
+	_dev;								\
+})
+
+#define dev_name(dev) dev_name((struct device *)dev)
+#endif
+
 #endif /* __BACKPORT_DEVICE_H */
diff --git a/backport/backport-include/linux/dma-mapping.h b/backport/backport-include/linux/dma-mapping.h
index 540355a..e5d1d3e 100644
--- a/backport/backport-include/linux/dma-mapping.h
+++ b/backport/backport-include/linux/dma-mapping.h
@@ -46,4 +46,47 @@ static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
 }
 #endif /* < 2.6.34 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#include <backport/magic.h>
+/* These really belong to asm/dma-mapping.h but it doesn't really matter */
+/* On 2.6.27 a second argument was added, on older kernels we ignore it */
+static inline int dma_mapping_error1(dma_addr_t dma_addr)
+{
+	/* use an inline to grab the old definition */
+	return dma_mapping_error(dma_addr);
+}
+
+#define dma_mapping_error2(pdef, dma_addr) \
+	dma_mapping_error1(dma_addr)
+
+#undef dma_mapping_error
+#define dma_mapping_error(...) \
+	macro_dispatcher(dma_mapping_error, __VA_ARGS__)(__VA_ARGS__)
+
+/* This kinda belongs into asm/dma-mapping.h or so, but doesn't matter */
+#ifdef CONFIG_ARM
+
+/*
+ * The caller asks to handle a range between offset and offset + size,
+ * but we process a larger range from 0 to offset + size due to lack of
+ * offset support.
+ */
+
+static inline void dma_sync_single_range_for_cpu(struct device *dev,
+		dma_addr_t handle, unsigned long offset, size_t size,
+		enum dma_data_direction dir)
+{
+	dma_sync_single_for_cpu(dev, handle, offset + size, dir);
+}
+
+static inline void dma_sync_single_range_for_device(struct device *dev,
+		dma_addr_t handle, unsigned long offset, size_t size,
+		enum dma_data_direction dir)
+{
+	dma_sync_single_for_device(dev, handle, offset + size, dir);
+}
+
+#endif /* arm */
+#endif
+
 #endif /* __BACKPORT_LINUX_DMA_MAPPING_H */
diff --git a/backport/backport-include/linux/ethtool.h b/backport/backport-include/linux/ethtool.h
index 4fb3dcc..9ed268b 100644
--- a/backport/backport-include/linux/ethtool.h
+++ b/backport/backport-include/linux/ethtool.h
@@ -28,4 +28,17 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
 #define ADVERTISED_10000baseR_FEC      (1 << 20)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
+					 __u32 speed)
+{
+	ep->speed = (__u16)speed;
+}
+
+static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
+{
+	return ep->speed;
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_ETHTOOL_H */
diff --git a/backport/backport-include/linux/firmware.h b/backport/backport-include/linux/firmware.h
index 9271f96..8db0953 100644
--- a/backport/backport-include/linux/firmware.h
+++ b/backport/backport-include/linux/firmware.h
@@ -18,4 +18,12 @@ int request_firmware_nowait(
 void release_firmware(const struct firmware *fw);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+struct builtin_fw {
+	char *name;
+	void *data;
+	unsigned long size;
+};
+#endif
+
 #endif /* __BACKPORT_LINUX_FIRMWARE_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index 19ea0e9..b0ab089 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -202,4 +202,8 @@ int hex_to_bin(char ch);
 	do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
 #endif
 
+#ifndef lower_32_bits
+#define lower_32_bits(n) ((u32)(n))
+#endif
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/list.h b/backport/backport-include/linux/list.h
index a02e0dd..8ad0b28 100644
--- a/backport/backport-include/linux/list.h
+++ b/backport/backport-include/linux/list.h
@@ -50,4 +50,62 @@
 
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+static inline void __list_cut_position(struct list_head *list,
+		struct list_head *head, struct list_head *entry)
+{
+	struct list_head *new_first = entry->next;
+	list->next = head->next;
+	list->next->prev = list;
+	list->prev = entry;
+	entry->next = list;
+	head->next = new_first;
+	new_first->prev = head;
+}
+
+static inline void list_cut_position(struct list_head *list,
+		struct list_head *head, struct list_head *entry)
+{
+	if (list_empty(head))
+		return;
+	if (list_is_singular(head) &&
+		(head->next != entry && head != entry))
+		return;
+	if (entry == head)
+		INIT_LIST_HEAD(list);
+	else
+		__list_cut_position(list, head, entry);
+}
+
+static inline void __compat_list_splice_new_27(const struct list_head *list,
+				 struct list_head *prev,
+				 struct list_head *next)
+{
+	struct list_head *first = list->next;
+	struct list_head *last = list->prev;
+
+	first->prev = prev;
+	prev->next = first;
+
+	last->next = next;
+	next->prev = last;
+}
+
+static inline void list_splice_tail(struct list_head *list,
+				struct list_head *head)
+{
+	if (!list_empty(list))
+		__compat_list_splice_new_27(list, head->prev, head);
+}
+
+static inline void list_splice_tail_init(struct list_head *list,
+					 struct list_head *head)
+{
+	if (!list_empty(list)) {
+		__compat_list_splice_new_27(list, head->prev, head);
+		INIT_LIST_HEAD(list);
+	}
+}
+#endif
+
 #endif /* __BACKPORT_LIST_H */
diff --git a/backport/backport-include/linux/lockdep.h b/backport/backport-include/linux/lockdep.h
index f7f7fb8..c194713 100644
--- a/backport/backport-include/linux/lockdep.h
+++ b/backport/backport-include/linux/lockdep.h
@@ -28,4 +28,27 @@
 #define lockdep_assert_held(l)			do { } while (0)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+/* Backport of:
+ *
+ * commit 3295f0ef9ff048a4619ede597ad9ec9cab725654
+ * Author: Ingo Molnar <mingo@elte.hu>
+ * Date:   Mon Aug 11 10:30:30 2008 +0200
+ *
+ *     lockdep: rename map_[acquire|release]() => lock_map_[acquire|release]()
+ */
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# ifdef CONFIG_PROVE_LOCKING
+#  define lock_map_acquire(l)		lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_)
+# else
+#  define lock_map_acquire(l)		lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_)
+# endif
+# define lock_map_release(l)			lock_release(l, 1, _THIS_IP_)
+#else
+# define lock_map_acquire(l)			do { } while (0)
+# define lock_map_release(l)			do { } while (0)
+#endif
+
+#endif /* < 2.6.27 */
+
 #endif /* __BACKPORT_LINUX_LOCKDEP_H */
diff --git a/backport/backport-include/linux/mmc/core.h b/backport/backport-include/linux/mmc/core.h
new file mode 100644
index 0000000..02d7a98
--- /dev/null
+++ b/backport/backport-include/linux/mmc/core.h
@@ -0,0 +1,12 @@
+#ifndef __BACKPORT_MMC_CORE_H
+#define __BACKPORT_MMC_CORE_H
+#include <linux/version.h>
+#include_next <linux/mmc/core.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+#define mmc_align_data_size LINUX_BACKPORT(mmc_align_data_size)
+extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
+#endif /* 2.6.24 - 2.6.26 */
+
+#endif /* __BACKPORT_MMC_CORE_H */
diff --git a/backport/backport-include/linux/mmc/sdio_func.h b/backport/backport-include/linux/mmc/sdio_func.h
index b596004..f32cafc 100644
--- a/backport/backport-include/linux/mmc/sdio_func.h
+++ b/backport/backport-include/linux/mmc/sdio_func.h
@@ -31,4 +31,10 @@ extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
 #define dev_to_sdio_func(d)	container_of(d, struct sdio_func, dev)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+#define sdio_align_size LINUX_BACKPORT(sdio_align_size)
+extern unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz);
+#endif /* 2.6.24 - 2.6.26 */
+
 #endif /* __BACKPORT_MMC_SDIO_FUNC_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index dc08764..ca2baf7 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -6,6 +6,7 @@
 
 /* older kernels don't include this here, we need it */
 #include <linux/ethtool.h>
+#include <linux/rculist.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 #define dev_change_net_namespace(a, b, c) (-EOPNOTSUPP)
@@ -405,4 +406,33 @@ do {								\
 #define NETDEV_PRE_UP		0x000D
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+/*
+ * On older kernels we do not have net_device Multi Queue support, but
+ * since we no longer use MQ on mac80211 we can simply use the 0 queue.
+ * Note that if other fullmac drivers make use of this they then need
+ * to be backported somehow or deal with just 1 queue from MQ.
+ */
+static inline void netif_tx_wake_all_queues(struct net_device *dev)
+{
+	netif_wake_queue(dev);
+}
+static inline void netif_tx_start_all_queues(struct net_device *dev)
+{
+	netif_start_queue(dev);
+}
+static inline void netif_tx_stop_all_queues(struct net_device *dev)
+{
+	netif_stop_queue(dev);
+}
+
+/*
+ * The net_device has a spin_lock on newer kernels, on older kernels we're out of luck
+ */
+#define netif_addr_lock_bh(dev)
+#define netif_addr_unlock_bh(dev)
+
+#define netif_wake_subqueue netif_start_subqueue
+#endif /* < 2.6.27 */
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index 94199bb..99091d5 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -173,4 +173,9 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
 int pci_wake_from_d3(struct pci_dev *dev, bool enable);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#define pci_pme_capable LINUX_BACKPORT(pci_pme_capable)
+bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
+#endif
+
 #endif /* _BACKPORT_LINUX_PCI_H */
diff --git a/backport/backport-include/linux/pci_regs.h b/backport/backport-include/linux/pci_regs.h
index 401875f..5cfa742 100644
--- a/backport/backport-include/linux/pci_regs.h
+++ b/backport/backport-include/linux/pci_regs.h
@@ -121,4 +121,8 @@
 #define  PCI_EXP_DEVCTL2_ARI	0x20    /* Alternative Routing-ID */
 #endif
 
+#ifndef PCI_PM_CAP_PME_SHIFT
+#define PCI_PM_CAP_PME_SHIFT	11
+#endif
+
 #endif /* __BACKPORT_UAPI_PCI_REGS_H */
diff --git a/backport/backport-include/linux/workqueue.h b/backport/backport-include/linux/workqueue.h
index 3a035de..9958715 100644
--- a/backport/backport-include/linux/workqueue.h
+++ b/backport/backport-include/linux/workqueue.h
@@ -71,6 +71,11 @@ static inline void backport_system_workqueue_destroy(void)
 }
 #endif /* < 2.6.36 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+/* I can't find a more suitable replacement... */
+#define flush_work(work) cancel_work_sync(work)
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 static inline void flush_delayed_work(struct delayed_work *dwork)
 {
diff --git a/backport/backport-include/net/iw_handler.h b/backport/backport-include/net/iw_handler.h
index 6776720..c418d7d 100644
--- a/backport/backport-include/net/iw_handler.h
+++ b/backport/backport-include/net/iw_handler.h
@@ -7,4 +7,21 @@
 #define wireless_send_event(a, b, c, d) wireless_send_event(a, b, c, (char * ) d)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#define iwe_stream_add_value(info, event, value, ends, iwe, event_len) iwe_stream_add_value(event, value, ends, iwe, event_len)
+#define iwe_stream_add_point(info, stream, ends, iwe, extra) iwe_stream_add_point(stream, ends, iwe, extra)
+#define iwe_stream_add_event(info, stream, ends, iwe, event_len) iwe_stream_add_event(stream, ends, iwe, event_len)
+
+#define IW_REQUEST_FLAG_COMPAT	0x0001	/* Compat ioctl call */
+
+static inline int iwe_stream_lcp_len(struct iw_request_info *info)
+{
+#ifdef CONFIG_COMPAT
+	if (info->flags & IW_REQUEST_FLAG_COMPAT)
+		return IW_EV_COMPAT_LCP_LEN;
+#endif
+	return IW_EV_LCP_LEN;
+}
+#endif
+
 #endif /* __BACKPORT_NET_IW_HANDLER_H */
diff --git a/backport/backport-include/net/sch_generic.h b/backport/backport-include/net/sch_generic.h
index 196d098..04997c7 100644
--- a/backport/backport-include/net/sch_generic.h
+++ b/backport/backport-include/net/sch_generic.h
@@ -22,6 +22,37 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
 #endif
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+static inline struct net_device *qdisc_dev(const struct Qdisc *qdisc)
+{
+	return qdisc->dev;
+}
+
+/*
+ * Backports 378a2f09 and c27f339a
+ * This may need a bit more work.
+ */
+enum net_xmit_qdisc_t {
+	__NET_XMIT_STOLEN = 0x00010000,
+	__NET_XMIT_BYPASS = 0x00020000,
+};
+
+struct qdisc_skb_cb {
+	unsigned int            pkt_len;
+	char                    data[];
+};
+
+static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb)
+{
+	return (struct qdisc_skb_cb *)skb->cb;
+}
+
+static inline unsigned int qdisc_pkt_len(struct sk_buff *skb)
+{
+	return qdisc_skb_cb(skb)->pkt_len;
+}
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)
 static inline void bstats_update(struct gnet_stats_basic_packed *bstats,
@@ -91,4 +122,11 @@ static inline int qdisc_qlen(const struct Qdisc *q)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+static inline bool qdisc_all_tx_empty(const struct net_device *dev)
+{
+	return skb_queue_empty(&dev->qdisc->q);
+}
+#endif
+
 #endif /* __BACKPORT_NET_SCH_GENERIC_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 34/42] backports: dissolve compat-2.6.26.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (32 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 33/42] backports: dissolve compat-2.6.27.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 35/42] backports: improve SIMPLE_DEV_PM_OPS macro Johannes Berg
                   ` (10 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/asm/unaligned.h       | 213 +++++++++++
 backport/backport-include/linux/compat-2.6.26.h | 456 ------------------------
 backport/backport-include/linux/device.h        |  14 +
 backport/backport-include/linux/input.h         |   4 +
 backport/backport-include/linux/jiffies.h       |  21 ++
 backport/backport-include/linux/kernel.h        |  35 ++
 backport/backport-include/linux/list.h          |   7 +
 backport/backport-include/linux/math64.h        |  31 ++
 backport/backport-include/linux/netdevice.h     |  17 +
 backport/backport-include/linux/pci-aspm.h      |  10 +
 backport/backport-include/net/net_namespace.h   |  35 ++
 11 files changed, 387 insertions(+), 456 deletions(-)
 create mode 100644 backport/backport-include/asm/unaligned.h
 delete mode 100644 backport/backport-include/linux/compat-2.6.26.h
 create mode 100644 backport/backport-include/linux/jiffies.h

diff --git a/backport/backport-include/asm/unaligned.h b/backport/backport-include/asm/unaligned.h
new file mode 100644
index 0000000..7f552b8
--- /dev/null
+++ b/backport/backport-include/asm/unaligned.h
@@ -0,0 +1,213 @@
+#ifndef __BACKPORT_ASM_UNALIGNED_H
+#define __BACKPORT_ASM_UNALIGNED_H
+#include_next <asm/unaligned.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+/*
+ * 2.6.26 added its own unaligned API which the
+ * new drivers can use. Lets port it here by including it in older
+ * kernels and also deal with the architecture handling here.
+ */
+#ifdef CONFIG_ALPHA
+
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* alpha */
+#ifdef CONFIG_ARM
+
+/* arm */
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* arm */
+#ifdef CONFIG_AVR32
+
+/*
+ * AVR32 can handle some unaligned accesses, depending on the
+ * implementation.  The AVR32 AP implementation can handle unaligned
+ * words, but halfwords must be halfword-aligned, and doublewords must
+ * be word-aligned.
+ *
+ * However, swapped word loads must be word-aligned so we can't
+ * optimize word loads in general.
+ */
+
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif
+#ifdef CONFIG_BLACKFIN
+
+#include <linux/unaligned/le_struct.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* blackfin */
+#ifdef CONFIG_CRIS
+
+/*
+ * CRIS can do unaligned accesses itself.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* cris */
+#ifdef CONFIG_FRV
+
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* frv */
+#ifdef CONFIG_H8300
+
+#include <linux/unaligned/be_memmove.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* h8300 */
+#ifdef  CONFIG_IA64
+
+#include <linux/unaligned/le_struct.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* ia64 */
+#ifdef CONFIG_M32R
+
+#if defined(__LITTLE_ENDIAN__)
+# include <linux/unaligned/le_memmove.h>
+# include <linux/unaligned/be_byteshift.h>
+# include <linux/unaligned/generic.h>
+#else
+# include <linux/unaligned/be_memmove.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+#endif
+
+#endif /* m32r */
+#ifdef CONFIG_M68K /* this handles both m68k and m68knommu */
+
+#ifdef CONFIG_COLDFIRE
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+#else
+
+/*
+ * The m68k can do unaligned accesses itself.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+#endif
+
+#endif /* m68k and m68knommu */
+#ifdef CONFIG_MIPS
+
+#if defined(__MIPSEB__)
+# include <linux/unaligned/be_struct.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+# define get_unaligned  __get_unaligned_be
+# define put_unaligned  __put_unaligned_be
+#elif defined(__MIPSEL__)
+# include <linux/unaligned/le_struct.h>
+# include <linux/unaligned/be_byteshift.h>
+# include <linux/unaligned/generic.h>
+#endif
+
+#endif /* mips */
+#ifdef CONFIG_MN10300
+
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* mn10300 */
+#ifdef CONFIG_PARISC
+
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* parisc */
+#ifdef CONFIG_PPC
+/*
+ * The PowerPC can do unaligned accesses itself in big endian mode.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* ppc */
+#ifdef CONFIG_S390
+
+/*
+ * The S390 can do unaligned accesses itself.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* s390 */
+#ifdef CONFIG_SUPERH
+
+/* SH can't handle unaligned accesses. */
+#ifdef __LITTLE_ENDIAN__
+# include <linux/unaligned/le_struct.h>
+# include <linux/unaligned/be_byteshift.h>
+# include <linux/unaligned/generic.h>
+#else
+# include <linux/unaligned/be_struct.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+#endif
+
+#endif /* sh - SUPERH */
+#ifdef CONFIG_SPARC
+
+/* sparc and sparc64 */
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif  /* sparc */
+#ifdef CONFIG_UML
+
+#include "asm/arch/unaligned.h"
+
+#endif /* um - uml */
+#ifdef CONFIG_V850
+
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* v850 */
+#ifdef CONFIG_X86
+/*
+ * The x86 can do unaligned accesses itself.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+
+#endif /* x86 */
+#ifdef CONFIG_XTENSA
+
+#ifdef __XTENSA_EL__
+# include <linux/unaligned/le_memmove.h>
+# include <linux/unaligned/be_byteshift.h>
+# include <linux/unaligned/generic.h>
+#elif defined(__XTENSA_EB__)
+# include <linux/unaligned/be_memmove.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+#else
+# error processor byte order undefined!
+#endif
+
+#endif /* xtensa */
+#endif /* < 2.6.26 */
+
+#endif /* __BACKPORT_ASM_UNALIGNED_H */
diff --git a/backport/backport-include/linux/compat-2.6.26.h b/backport/backport-include/linux/compat-2.6.26.h
deleted file mode 100644
index b8d9dc6..0000000
--- a/backport/backport-include/linux/compat-2.6.26.h
+++ /dev/null
@@ -1,456 +0,0 @@
-#ifndef LINUX_26_26_COMPAT_H
-#define LINUX_26_26_COMPAT_H
-
-#include <linux/version.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
-
-#include <linux/device.h>
-#include <linux/list.h>
-#include <linux/kernel.h>
-#include <linux/jiffies.h>
-#include <net/sock.h>
-#include <linux/fs.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
-#include <net/net_namespace.h>
-#endif
-#include <linux/fs.h>
-#include <linux/types.h>
-#include <asm/div64.h>
-
-/* These jiffie helpers added as of 2.6.26 */
-
-/*
- * These four macros compare jiffies and 'a' for convenience.
- */
-
-/* time_is_before_jiffies(a) return true if a is before jiffies */
-#define time_is_before_jiffies(a) time_after(jiffies, a)
-
-/* time_is_after_jiffies(a) return true if a is after jiffies */
-#define time_is_after_jiffies(a) time_before(jiffies, a)
-
-/* time_is_before_eq_jiffies(a) return true if a is before or equal to jiffies*/
-#define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a)
-
-/* time_is_after_eq_jiffies(a) return true if a is after or equal to jiffies*/
-#define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a)
-
-/* This comes from include/linux/input.h */
-#define SW_RFKILL_ALL           0x03  /* rfkill master switch, type "any"
-					 set = radio enabled */
-
-/* From kernel.h */
-#define USHORT_MAX      ((u16)(~0U))
-#define SHORT_MAX       ((s16)(USHORT_MAX>>1))
-#define SHORT_MIN       (-SHORT_MAX - 1)
-
-#define dev_set_name LINUX_BACKPORT(dev_set_name)
-extern int dev_set_name(struct device *dev, const char *name, ...)
-			__attribute__((format(printf, 2, 3)));
-
-/**
- * clamp - return a value clamped to a given range with strict typechecking
- * @val: current value
- * @min: minimum allowable value
- * @max: maximum allowable value
- *
- * This macro does strict typechecking of min/max to make sure they are of the
- * same type as val.  See the unnecessary pointer comparisons.
- */
-#define clamp(val, min, max) ({			\
-	typeof(val) __val = (val);		\
-	typeof(min) __min = (min);		\
-	typeof(max) __max = (max);		\
-	(void) (&__val == &__min);		\
-	(void) (&__val == &__max);		\
-	__val = __val < __min ? __min: __val;	\
-	__val > __max ? __max: __val; })
-
-/**
- * clamp_t - return a value clamped to a given range using a given type
- * @type: the type of variable to use
- * @val: current value
- * @min: minimum allowable value
- * @max: maximum allowable value
- *
- * This macro does no typechecking and uses temporary variables of type
- * 'type' to make all the comparisons.
- */
-#define clamp_t(type, val, min, max) ({		\
-	type __val = (val);			\
-	type __min = (min);			\
-	type __max = (max);			\
-	__val = __val < __min ? __min: __val;	\
-	__val > __max ? __max: __val; })
-
-
-/* from include/linux/device.h */
-/* device_create_drvdata() is new */
-extern struct device *device_create_drvdata(struct class *cls,
-	struct device *parent,
-	dev_t devt,
-	void *drvdata,
-	const char *fmt, ...)
-__attribute__((format(printf, 5, 6)));
-
-/* This is from include/linux/list.h */
-
-/**
- * list_is_singular - tests whether a list has just one entry.
- * @head: the list to test.
- */
-static inline int list_is_singular(const struct list_head *head)
-{
-	return !list_empty(head) && (head->next == head->prev);
-}
-
-/* This is from include/linux/device.h, which was added as of 2.6.26 */
-static inline const char *dev_name(struct device *dev)
-{
-	/* will be changed into kobject_name(&dev->kobj) in the near future */
-	return dev->bus_id;
-}
-
-/* This is from include/linux/kernel.h, which was added as of 2.6.26 */
-
-/**
- * clamp_val - return a value clamped to a given range using val's type
- * @val: current value
- * @min: minimum allowable value
- * @max: maximum allowable value
- *
- * This macro does no typechecking and uses temporary variables of whatever
- * type the input argument 'val' is.  This is useful when val is an unsigned
- * type and min and max are literals that will otherwise be assigned a signed
- * integer type.
- */
-
-#define clamp_val(val, min, max) ({             \
-	typeof(val) __val = (val);              \
-	typeof(val) __min = (min);              \
-	typeof(val) __max = (max);              \
-	__val = __val < __min ? __min: __val;   \
-	__val > __max ? __max: __val; })
-
-/* This comes from include/net/net_namespace.h */
-
-#ifdef CONFIG_NET_NS
-static inline
-int net_eq(const struct net *net1, const struct net *net2)
-{
-	return net1 == net2;
-}
-#else
-static inline
-int net_eq(const struct net *net1, const struct net *net2)
-{
-	return 1;
-}
-#endif
-
-static inline
-void dev_net_set(struct net_device *dev, struct net *net)
-{
-#ifdef CONFIG_NET_NS
-	release_net(dev->nd_net);
-	dev->nd_net = hold_net(net);
-#endif
-}
-
-static inline
-struct net *sock_net(const struct sock *sk)
-{
-#ifdef CONFIG_NET_NS
-	return sk->sk_net;
-#else
-	return &init_net;
-#endif
-}
-
-/* This comes from include/linux/netdevice.h */
-
-/*
- * Net namespace inlines
- */
-static inline
-struct net *dev_net(const struct net_device *dev)
-{
-#ifdef CONFIG_NET_NS
-	/*
-	 * compat-wirelss backport note:
-	 * For older kernels we may just need to always return init_net,
-	 * not sure when we added dev->nd_net.
-	 */
-	return dev->nd_net;
-#else
-	return &init_net;
-#endif
-}
-
-
-/*
- * 2.6.26 added its own unaligned API which the
- * new drivers can use. Lets port it here by including it in older
- * kernels and also deal with the architecture handling here.
- */
-
-#ifdef CONFIG_ALPHA
-
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* alpha */
-#ifdef CONFIG_ARM
-
-/* arm */
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* arm */
-#ifdef CONFIG_AVR32
-
-/*
- * AVR32 can handle some unaligned accesses, depending on the
- * implementation.  The AVR32 AP implementation can handle unaligned
- * words, but halfwords must be halfword-aligned, and doublewords must
- * be word-aligned.
- *
- * However, swapped word loads must be word-aligned so we can't
- * optimize word loads in general.
- */
-
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif
-#ifdef CONFIG_BLACKFIN
-
-#include <linux/unaligned/le_struct.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* blackfin */
-#ifdef CONFIG_CRIS
-
-/*
- * CRIS can do unaligned accesses itself.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* cris */
-#ifdef CONFIG_FRV
-
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* frv */
-#ifdef CONFIG_H8300
-
-#include <linux/unaligned/be_memmove.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* h8300 */
-#ifdef  CONFIG_IA64
-
-#include <linux/unaligned/le_struct.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* ia64 */
-#ifdef CONFIG_M32R
-
-#if defined(__LITTLE_ENDIAN__)
-# include <linux/unaligned/le_memmove.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-#else
-# include <linux/unaligned/be_memmove.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-#endif
-
-#endif /* m32r */
-#ifdef CONFIG_M68K /* this handles both m68k and m68knommu */
-
-#ifdef CONFIG_COLDFIRE
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-#else
-
-/*
- * The m68k can do unaligned accesses itself.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-#endif
-
-#endif /* m68k and m68knommu */
-#ifdef CONFIG_MIPS
-
-#if defined(__MIPSEB__)
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-# define get_unaligned  __get_unaligned_be
-# define put_unaligned  __put_unaligned_be
-#elif defined(__MIPSEL__)
-# include <linux/unaligned/le_struct.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-#endif
-
-#endif /* mips */
-#ifdef CONFIG_MN10300
-
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* mn10300 */
-#ifdef CONFIG_PARISC
-
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* parisc */
-#ifdef CONFIG_PPC
-/*
- * The PowerPC can do unaligned accesses itself in big endian mode.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* ppc */
-#ifdef CONFIG_S390
-
-/*
- * The S390 can do unaligned accesses itself.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* s390 */
-#ifdef CONFIG_SUPERH
-
-/* SH can't handle unaligned accesses. */
-#ifdef __LITTLE_ENDIAN__
-# include <linux/unaligned/le_struct.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-#else
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-#endif
-
-#endif /* sh - SUPERH */
-#ifdef CONFIG_SPARC
-
-/* sparc and sparc64 */
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif  /* sparc */
-#ifdef CONFIG_UML
-
-#include "asm/arch/unaligned.h"
-
-#endif /* um - uml */
-#ifdef CONFIG_V850
-
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* v850 */
-#ifdef CONFIG_X86
-/*
- * The x86 can do unaligned accesses itself.
- */
-#include <linux/unaligned/access_ok.h>
-#include <linux/unaligned/generic.h>
-
-#endif /* x86 */
-#ifdef CONFIG_XTENSA
-
-#ifdef __XTENSA_EL__
-# include <linux/unaligned/le_memmove.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-#elif defined(__XTENSA_EB__)
-# include <linux/unaligned/be_memmove.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-#else
-# error processor byte order undefined!
-#endif
-
-#endif /* xtensa */
-
-#define PCIE_LINK_STATE_L0S	1
-#define PCIE_LINK_STATE_L1	2
-#define PCIE_LINK_STATE_CLKPM	4
-
-static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
-{
-}
-/* source: include/linux/pci-aspm.h */
-
-
-#if BITS_PER_LONG == 64
-
-/**
- * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder
- *
- * This is commonly provided by 32bit archs to provide an optimized 64bit
- * divide.
- */
-static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
-{
-	*remainder = dividend % divisor;
-	return dividend / divisor;
-}
-
-#elif BITS_PER_LONG == 32
-
-#ifndef div_u64_rem
-static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
-{
-	*remainder = do_div(dividend, divisor);
-	return dividend;
-}
-#endif
-
-#endif /* BITS_PER_LONG */
-
-/**
- * div_u64 - unsigned 64bit divide with 32bit divisor
- *
- * This is the most common 64bit divide and should be used if possible,
- * as many 32bit archs can optimize this variant better than a full 64bit
- * divide.
- */
-#ifndef div_u64
-static inline u64 div_u64(u64 dividend, u32 divisor)
-{
-	u32 remainder;
-	return div_u64_rem(dividend, divisor, &remainder);
-}
-#endif
-/* source: include/math64.h */
-
-#define hex_asc_lo(x)	hex_asc((x) & 0x0f)
-#define hex_asc_hi(x)	hex_asc(((x) & 0xf0) >> 4)
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) */
-
-#endif /* LINUX_26_26_COMPAT_H */
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 07ebe9f..f672a99 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -122,6 +122,14 @@ static inline void device_unlock(struct device *dev)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+static inline const char *dev_name(struct device *dev)
+{
+	/* will be changed into kobject_name(&dev->kobj) in the near future */
+	return dev->bus_id;
+}
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
 static inline void dev_set_uevent_suppress(struct device *dev, int val)
 {
@@ -141,4 +149,10 @@ static inline void dev_set_uevent_suppress(struct device *dev, int val)
 #define dev_name(dev) dev_name((struct device *)dev)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+#define dev_set_name LINUX_BACKPORT(dev_set_name)
+extern int dev_set_name(struct device *dev, const char *name, ...)
+			__attribute__((format(printf, 2, 3)));
+#endif
+
 #endif /* __BACKPORT_DEVICE_H */
diff --git a/backport/backport-include/linux/input.h b/backport/backport-include/linux/input.h
index fa95263..3442db0 100644
--- a/backport/backport-include/linux/input.h
+++ b/backport/backport-include/linux/input.h
@@ -14,4 +14,8 @@
 #define KEY_RFKILL		247
 #endif
 
+#ifndef SW_RFKILL_ALL
+#define SW_RFKILL_ALL           0x03
+#endif
+
 #endif /* __BACKPORT_INPUT_H */
diff --git a/backport/backport-include/linux/jiffies.h b/backport/backport-include/linux/jiffies.h
new file mode 100644
index 0000000..9e74e6a
--- /dev/null
+++ b/backport/backport-include/linux/jiffies.h
@@ -0,0 +1,21 @@
+#ifndef __BACKPORT_LNIUX_JIFFIES_H
+#define __BACKPORT_LNIUX_JIFFIES_H
+#include_next <linux/jiffies.h>
+
+#ifndef time_is_before_jiffies
+#define time_is_before_jiffies(a) time_after(jiffies, a)
+#endif
+
+#ifndef time_is_after_jiffies
+#define time_is_after_jiffies(a) time_before(jiffies, a)
+#endif
+
+#ifndef time_is_before_eq_jiffies
+#define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a)
+#endif
+
+#ifndef time_is_after_eq_jiffies
+#define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a)
+#endif
+
+#endif /* __BACKPORT_LNIUX_JIFFIES_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index b0ab089..24755b0 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -206,4 +206,39 @@ int hex_to_bin(char ch);
 #define lower_32_bits(n) ((u32)(n))
 #endif
 
+#ifndef USHORT_MAX
+#define USHORT_MAX      ((u16)(~0U))
+#define SHORT_MAX       ((s16)(USHORT_MAX>>1))
+#define SHORT_MIN       (-SHORT_MAX - 1)
+#endif
+
+#ifndef clamp
+#define clamp(val, min, max) ({			\
+	typeof(val) __val = (val);		\
+	typeof(min) __min = (min);		\
+	typeof(max) __max = (max);		\
+	(void) (&__val == &__min);		\
+	(void) (&__val == &__max);		\
+	__val = __val < __min ? __min: __val;	\
+	__val > __max ? __max: __val; })
+#endif
+
+#ifndef clamp_t
+#define clamp_t(type, val, min, max) ({		\
+	type __val = (val);			\
+	type __min = (min);			\
+	type __max = (max);			\
+	__val = __val < __min ? __min: __val;	\
+	__val > __max ? __max: __val; })
+#endif
+
+#ifndef clamp_val
+#define clamp_val(val, min, max) ({             \
+	typeof(val) __val = (val);              \
+	typeof(val) __min = (min);              \
+	typeof(val) __max = (max);              \
+	__val = __val < __min ? __min: __val;   \
+	__val > __max ? __max: __val; })
+#endif
+
 #endif /* __BACKPORT_KERNEL_H */
diff --git a/backport/backport-include/linux/list.h b/backport/backport-include/linux/list.h
index 8ad0b28..fb5ee4b 100644
--- a/backport/backport-include/linux/list.h
+++ b/backport/backport-include/linux/list.h
@@ -50,6 +50,13 @@
 
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+static inline int list_is_singular(const struct list_head *head)
+{
+	return !list_empty(head) && (head->next == head->prev);
+}
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
 static inline void __list_cut_position(struct list_head *list,
 		struct list_head *head, struct list_head *entry)
diff --git a/backport/backport-include/linux/math64.h b/backport/backport-include/linux/math64.h
index eb9e8e1..7f3a81b 100644
--- a/backport/backport-include/linux/math64.h
+++ b/backport/backport-include/linux/math64.h
@@ -7,4 +7,35 @@
 #include_next <linux/math64.h>
 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+#if BITS_PER_LONG == 64
+
+static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
+{
+	*remainder = dividend % divisor;
+	return dividend / divisor;
+}
+
+#elif BITS_PER_LONG == 32
+
+#ifndef div_u64_rem
+static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
+{
+	*remainder = do_div(dividend, divisor);
+	return dividend;
+}
+#endif
+
+#endif /* BITS_PER_LONG */
+
+#ifndef div_u64
+static inline u64 div_u64(u64 dividend, u32 divisor)
+{
+	u32 remainder;
+	return div_u64_rem(dividend, divisor, &remainder);
+}
+#endif
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) */
+
 #endif	/* _COMPAT_LINUX_MATH64_H */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index ca2baf7..74230d9 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -435,4 +435,21 @@ static inline void netif_tx_stop_all_queues(struct net_device *dev)
 #define netif_wake_subqueue netif_start_subqueue
 #endif /* < 2.6.27 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+static inline
+struct net *dev_net(const struct net_device *dev)
+{
+#ifdef CONFIG_NET_NS
+	/*
+	 * compat-wirelss backport note:
+	 * For older kernels we may just need to always return init_net,
+	 * not sure when we added dev->nd_net.
+	 */
+	return dev->nd_net;
+#else
+	return &init_net;
+#endif
+}
+#endif
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/backport-include/linux/pci-aspm.h b/backport/backport-include/linux/pci-aspm.h
index 2bc6efb..367112e 100644
--- a/backport/backport-include/linux/pci-aspm.h
+++ b/backport/backport-include/linux/pci-aspm.h
@@ -3,3 +3,13 @@
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25))
 #include_next <linux/pci-aspm.h>
 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)) */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+#define PCIE_LINK_STATE_L0S	1
+#define PCIE_LINK_STATE_L1	2
+#define PCIE_LINK_STATE_CLKPM	4
+
+static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
+{
+}
+#endif
diff --git a/backport/backport-include/net/net_namespace.h b/backport/backport-include/net/net_namespace.h
index edd02ff..f23702f 100644
--- a/backport/backport-include/net/net_namespace.h
+++ b/backport/backport-include/net/net_namespace.h
@@ -25,4 +25,39 @@ static inline struct net *read_pnet(struct net * const *pnet)
 #endif
 #endif /* < 2.6.29 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+#ifdef CONFIG_NET_NS
+static inline
+int net_eq(const struct net *net1, const struct net *net2)
+{
+	return net1 == net2;
+}
+#else
+static inline
+int net_eq(const struct net *net1, const struct net *net2)
+{
+	return 1;
+}
+#endif
+
+static inline
+void dev_net_set(struct net_device *dev, struct net *net)
+{
+#ifdef CONFIG_NET_NS
+	release_net(dev->nd_net);
+	dev->nd_net = hold_net(net);
+#endif
+}
+
+static inline
+struct net *sock_net(const struct sock *sk)
+{
+#ifdef CONFIG_NET_NS
+	return sk->sk_net;
+#else
+	return &init_net;
+#endif
+}
+#endif /* < 2.6.26 */
+
 #endif	/* _COMPAT_NET_NET_NAMESPACE_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 35/42] backports: improve SIMPLE_DEV_PM_OPS macro
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (33 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 34/42] backports: dissolve compat-2.6.26.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 36/42] backports: avoid pr_fmt warning from our export.h Johannes Berg
                   ` (9 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

To avoid warnings on old kernels, improve the macro
and give it some content rather than nothing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/pm.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/backport/backport-include/linux/pm.h b/backport/backport-include/linux/pm.h
index a78477c..70f3a21 100644
--- a/backport/backport-include/linux/pm.h
+++ b/backport/backport-include/linux/pm.h
@@ -51,7 +51,10 @@ struct dev_pm_ops name = { \
 	.restore = resume_fn, \
 }
 #else
-#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn)
+#define ___BACKPORT_PASTE(a, b) a##b
+#define __BACKPORT_PASTE(a, b) ___BACKPORT_PASTE(a,b)
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
+	struct {} __maybe_unused __BACKPORT_PASTE(__backport_avoid_warning_, __LINE__)
 #endif /* >= 2.6.29 */
 #endif /* < 2.6.32 */
 
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 36/42] backports: avoid pr_fmt warning from our export.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (34 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 35/42] backports: improve SIMPLE_DEV_PM_OPS macro Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 37/42] backports: fix USB PM in case of !CONFIG_USB_SUSPEND Johannes Berg
                   ` (8 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

On old kernels, linux/export.h didn't exist and we need
to include linux/module.h instead. That includes a lot
though and thus defines pr_fmt already. Avoid redefine
warnings by checking if it's defined before and if not
undefining it afterwards.

However, to then avoid issues with kernel.h/printk.h
not defining it again, we need to override there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/export.h |  7 +++++++
 backport/backport-include/linux/kernel.h | 11 +++++++++++
 backport/backport-include/linux/printk.h |  9 ++++++---
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/backport/backport-include/linux/export.h b/backport/backport-include/linux/export.h
index f7842b7..3686197 100644
--- a/backport/backport-include/linux/export.h
+++ b/backport/backport-include/linux/export.h
@@ -6,7 +6,14 @@
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
 #include_next <linux/export.h>
 #else
+#ifndef pr_fmt
+#define backport_undef_pr_fmt
+#endif
 #include <linux/module.h>
+#ifdef backport_undef_pr_fmt
+#undef pr_fmt
+#undef backport_undef_pr_fmt
+#endif
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
 
 #endif	/* _COMPAT_LINUX_EXPORT_H */
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index 24755b0..df344eb 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -242,3 +242,14 @@ int hex_to_bin(char ch);
 #endif
 
 #endif /* __BACKPORT_KERNEL_H */
+
+/*
+ * We have to do this outside the include guard, because
+ * out own header (linux/export.h) has to include kernel.h
+ * indirectly (through module.h) and then undef's pr_fmt.
+ * Then, when the real kernel.h gets included again, it's
+ * not defined and we get problems ...
+ */
+#ifndef pr_fmt
+#define pr_fmt(msg) msg
+#endif
diff --git a/backport/backport-include/linux/printk.h b/backport/backport-include/linux/printk.h
index 00d86f3..6bc9931 100644
--- a/backport/backport-include/linux/printk.h
+++ b/backport/backport-include/linux/printk.h
@@ -9,9 +9,7 @@
 #include <linux/kernel.h>
 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35)) */
 
-#ifndef pr_fmt
-#define pr_fmt(fmt) fmt
-#endif
+/* see pr_fmt at end of file */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
 /* backports 7a555613 */
@@ -100,3 +98,8 @@ int no_printk(const char *s, ...) { return 0; }
 #endif
 
 #endif	/* _COMPAT_LINUX_PRINTK_H */
+
+/* This must be outside -- see also kernel.h */
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 37/42] backports: fix USB PM in case of !CONFIG_USB_SUSPEND
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (35 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 36/42] backports: avoid pr_fmt warning from our export.h Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 38/42] backports: avoid module parameter warnings Johannes Berg
                   ` (7 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Even in this case, the variable is an int on old kernels.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/usb.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index 3821575..8ea9d75 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -83,11 +83,19 @@ extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf);
 #else
 static inline void usb_autopm_get_interface_no_resume(struct usb_interface *intf)
 {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
 	atomic_inc(&intf->pm_usage_cnt);
+#else
+	intf->pm_usage_cnt++;
+#endif
 }
 static inline void usb_autopm_put_interface_no_suspend(struct usb_interface *intf)
 {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
 	atomic_dec(&intf->pm_usage_cnt);
+#else
+	intf->pm_usage_cnt--;
+#endif
 }
 #endif /* CONFIG_USB_SUSPEND */
 #endif /* < 2.6.33 */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 38/42] backports: avoid module parameter warnings
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (36 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 37/42] backports: fix USB PM in case of !CONFIG_USB_SUSPEND Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:53 ` [RFC/RFT 39/42] backports: avoid vfree() const warning Johannes Berg
                   ` (6 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

On old kernels, boolean module parameters had to be int.
When we backport, they're bool, and thus cause warnings.
Suppress the warnings by redefining the parameter check,
it's not entirely clear that it'll do the right thing
though?

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/module.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backport/backport-include/linux/module.h b/backport/backport-include/linux/module.h
index 6bddc76..82c96bd 100644
--- a/backport/backport-include/linux/module.h
+++ b/backport/backport-include/linux/module.h
@@ -59,4 +59,9 @@ extern void backport_dependency_symbol(void);
 	}								\
 	void cleanup_module(void) __attribute__((alias("__exit_compat")));
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+#undef param_check_bool
+#define param_check_bool(name, p) __param_check(name, p, bool)
+#endif
+
 #endif /* __BACKPORT_LINUX_MODULE_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 39/42] backports: avoid vfree() const warning
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (37 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 38/42] backports: avoid module parameter warnings Johannes Berg
@ 2013-04-13 23:53 ` Johannes Berg
  2013-04-13 23:54 ` [RFC/RFT 40/42] backports: include hardirq into netdevice.h Johannes Berg
                   ` (5 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:53 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

On newer kernels const pointers can be passed to vfree()
and vunmap(), doing so on old kernels causes warnings
that we can suppress with a cast.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/vmalloc.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/backport/backport-include/linux/vmalloc.h b/backport/backport-include/linux/vmalloc.h
index c47536f..9e8ff3b 100644
--- a/backport/backport-include/linux/vmalloc.h
+++ b/backport/backport-include/linux/vmalloc.h
@@ -3,6 +3,12 @@
 #include_next <linux/vmalloc.h>
 #include <linux/version.h>
 
+/* avoid warnings due to b3bdda02aa547a0753b4fdbc105e86ef9046b30b */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#define vfree(ptr) vfree((void *)(ptr))
+#define vunmap(ptr) vunmap((void *)(ptr))
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 #define vzalloc LINUX_BACKPORT(vzalloc)
 extern void *vzalloc(unsigned long size);
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 40/42] backports: include hardirq into netdevice.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (38 preceding siblings ...)
  2013-04-13 23:53 ` [RFC/RFT 39/42] backports: avoid vfree() const warning Johannes Berg
@ 2013-04-13 23:54 ` Johannes Berg
  2013-04-13 23:54 ` [RFC/RFT 41/42] backports: add vgaarb.h Johannes Berg
                   ` (4 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:54 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

On newer kernels this is included (indirectly) and
unfortunately some drivers rely on it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/netdevice.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 74230d9..11e2058 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -7,6 +7,11 @@
 /* older kernels don't include this here, we need it */
 #include <linux/ethtool.h>
 #include <linux/rculist.h>
+/*
+ * new kernels include <net/netprio_cgroup.h> which
+ * has this ... and some drivers rely on it :-(
+ */
+#include <linux/hardirq.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 #define dev_change_net_namespace(a, b, c) (-EOPNOTSUPP)
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 41/42] backports: add vgaarb.h
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (39 preceding siblings ...)
  2013-04-13 23:54 ` [RFC/RFT 40/42] backports: include hardirq into netdevice.h Johannes Berg
@ 2013-04-13 23:54 ` Johannes Berg
  2013-04-13 23:54 ` [RFC/RFT 42/42] backports: automatically backport EWMA lib Johannes Berg
                   ` (3 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:54 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This is needed as old versions of it didn't properly
declare struct pci_dev.

Additionally, not all versions included video/vga.h
which causes issues as that pulls in some required
definitions.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/vgaarb.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 backport/backport-include/linux/vgaarb.h

diff --git a/backport/backport-include/linux/vgaarb.h b/backport/backport-include/linux/vgaarb.h
new file mode 100644
index 0000000..92f5a72
--- /dev/null
+++ b/backport/backport-include/linux/vgaarb.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_LINUX_VGAARB_H
+#define __BACKPORT_LINUX_VGAARB_H
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
+struct pci_dev;
+#endif
+#include <video/vga.h>
+#include_next <linux/vgaarb.h>
+
+#endif /* __BACKPORT_LINUX_VGAARB_H */
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [RFC/RFT 42/42] backports: automatically backport EWMA lib
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (40 preceding siblings ...)
  2013-04-13 23:54 ` [RFC/RFT 41/42] backports: add vgaarb.h Johannes Berg
@ 2013-04-13 23:54 ` Johannes Berg
  2013-04-13 23:57 ` [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (2 subsequent siblings)
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:54 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Use the scripting to always copy the latest version.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/average.h | 34 -------------------
 backport/compat/Kconfig                   |  2 ++
 backport/compat/Makefile                  |  1 -
 backport/compat/average.c                 | 54 -------------------------------
 4 files changed, 2 insertions(+), 89 deletions(-)
 delete mode 100644 backport/backport-include/linux/average.h
 delete mode 100644 backport/compat/average.c

diff --git a/backport/backport-include/linux/average.h b/backport/backport-include/linux/average.h
deleted file mode 100644
index 2d6210e..0000000
--- a/backport/backport-include/linux/average.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <linux/version.h>
-
-#ifndef CPTCFG_BACKPORT_BUILD_AVERAGE
-#include_next <linux/average.h>
-#else
-/* Exponentially weighted moving average (EWMA) */
-
-/* For more documentation see lib/average.c */
-
-struct ewma {
-	unsigned long internal;
-	unsigned long factor;
-	unsigned long weight;
-};
-
-#define ewma_init LINUX_BACKPORT(ewma_init)
-extern void ewma_init(struct ewma *avg, unsigned long factor,
-		      unsigned long weight);
-
-#define ewma_add LINUX_BACKPORT(ewma_add)
-extern struct ewma *ewma_add(struct ewma *avg, unsigned long val);
-
-#define ewma_read LINUX_BACKPORT(ewma_read)
-/**
- * ewma_read() - Get average value
- * @avg: Average structure
- *
- * Returns the average value held in @avg.
- */
-static inline unsigned long ewma_read(const struct ewma *avg)
-{
-	return avg->internal >> avg->factor;
-}
-#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37)) */
diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index df58dcc..0a2499e 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -116,6 +116,8 @@ config BACKPORT_BUILD_AVERAGE
 	depends on !AVERAGE
 	default y if BACKPORT_USERSEL_BUILD_ALL
 	default y if BACKPORT_AVERAGE
+	#h-file linux/average.h
+	#c-file lib/average.c
 
 config BACKPORT_AVERAGE
 	bool
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 59584f1..41f223f 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -24,7 +24,6 @@ compat-$(CPTCFG_BACKPORT_KERNEL_2_6_34) += compat-2.6.34.o
 compat-$(CPTCFG_BACKPORT_KERNEL_2_6_35) += compat-2.6.35.o
 compat-$(CPTCFG_BACKPORT_KERNEL_2_6_36) += compat-2.6.36.o
 compat-$(CPTCFG_BACKPORT_KERNEL_2_6_37) += compat-2.6.37.o
-compat-$(CPTCFG_BACKPORT_BUILD_AVERAGE) += average.o
 compat-$(CPTCFG_BACKPORT_KERNEL_2_6_39) += compat-2.6.39.o kstrtox.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_0) += compat-3.0.o
 compat-$(CPTCFG_BACKPORT_KERNEL_3_1) += compat-3.1.o
diff --git a/backport/compat/average.c b/backport/compat/average.c
deleted file mode 100644
index b7a51a1..0000000
--- a/backport/compat/average.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2010    Hauke Mehrtens <hauke@hauke-m.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 2.6.38.
- */
-
-#include <linux/average.h>
-#include <linux/module.h>
-#include <linux/bug.h>
-#include <linux/log2.h>
-
-/**
- * ewma_init() - Initialize EWMA parameters
- * @avg: Average structure
- * @factor: Factor to use for the scaled up internal value. The maximum value
- *	of averages can be ULONG_MAX/(factor*weight). For performance reasons
- *	factor has to be a power of 2.
- * @weight: Exponential weight, or decay rate. This defines how fast the
- *	influence of older values decreases. For performance reasons weight has
- *	to be a power of 2.
- *
- * Initialize the EWMA parameters for a given struct ewma @avg.
- */
-void ewma_init(struct ewma *avg, unsigned long factor, unsigned long weight)
-{
-	WARN_ON(!is_power_of_2(weight) || !is_power_of_2(factor));
-
-	avg->weight = ilog2(weight);
-	avg->factor = ilog2(factor);
-	avg->internal = 0;
-}
-EXPORT_SYMBOL_GPL(ewma_init);
-
-/**
- * ewma_add() - Exponentially weighted moving average (EWMA)
- * @avg: Average structure
- * @val: Current value
- *
- * Add a sample to the average.
- */
-struct ewma *ewma_add(struct ewma *avg, unsigned long val)
-{
-	avg->internal = avg->internal  ?
-		(((avg->internal << avg->weight) - avg->internal) +
-			(val << avg->factor)) >> avg->weight :
-		(val << avg->factor);
-	return avg;
-}
-EXPORT_SYMBOL_GPL(ewma_add);
-
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [RFC/RFT 00/42] explode header files
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (41 preceding siblings ...)
  2013-04-13 23:54 ` [RFC/RFT 42/42] backports: automatically backport EWMA lib Johannes Berg
@ 2013-04-13 23:57 ` Johannes Berg
  2013-04-14  0:17 ` Johannes Berg
  2013-04-15 11:16 ` Johannes Berg
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-13 23:57 UTC (permalink / raw)
  To: backports

The full diffstat is too long really, but the summary is this:

271 files changed, 6298 insertions(+), 9005 deletions(-)

Obviously the deletions are due to the pr_fmt patches getting killed.

This is also in my test branch:
http://git.sipsolutions.net/?p=backports.git;a=shortlog;h=refs/heads/test

johannes


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [RFC/RFT 00/42] explode header files
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (42 preceding siblings ...)
  2013-04-13 23:57 ` [RFC/RFT 00/42] explode header files Johannes Berg
@ 2013-04-14  0:17 ` Johannes Berg
  2013-04-15 11:16 ` Johannes Berg
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-14  0:17 UTC (permalink / raw)
  To: backports


> Before I rebased onto the media drivers this was pretty much
> passing ckmake --allyesconfig, now minor issues could have
> come up that I need to solve, but generally this should be
> fine. I did solve the issues that I saw in ckmake before.

Well, ckmake isn't quite happy, it's missing I2C_CLIENT_SCCB ... that
seems to be more of an issue with the media backport? Anyway, that'll be
trivial to fix.

johannes


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [RFC/RFT 00/42] explode header files
  2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
                   ` (43 preceding siblings ...)
  2013-04-14  0:17 ` Johannes Berg
@ 2013-04-15 11:16 ` Johannes Berg
  44 siblings, 0 replies; 46+ messages in thread
From: Johannes Berg @ 2013-04-15 11:16 UTC (permalink / raw)
  To: backports

On Sun, 2013-04-14 at 01:53 +0200, Johannes Berg wrote:
> As we discussed recently, it's better to explode our backport
> header files into the names that the kernel uses instead of
> pre-including half the world from the gcc command line. Doing
> so is obviously a lot of work and can't really be done in a
> way that would continue working inbetween the patch series,
> so I'm doing it per kernel version (or rather compat-x.y.z
> header.)
> 
> Before I rebased onto the media drivers this was pretty much
> passing ckmake --allyesconfig, now minor issues could have
> come up that I need to solve, but generally this should be
> fine. I did solve the issues that I saw in ckmake before.

After fixing a few issues, I'm passing ckmake --allyesconfig with just a
few linker issues that also seem to exist without these patches.

I'm pushing this. I expect we'll find some issues with this and the
other stuff still, but there's no way to fix all of them anyway.

johannes


^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2013-04-15 11:16 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-13 23:53 [RFC/RFT 00/42] explode header files Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 01/42] backports: average: backport efficiency improvements Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 02/42] backports: fix includes in backport code Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 03/42] backports: patch tracing for older kernels Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 04/42] backports: move header files Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 05/42] backports: fix dma-buf backport patch Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 06/42] backports: remove support for < 2.6.24 Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 07/42] backports: remove __inet_lookup_established Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 08/42] backports: dissolve compat-3.9.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 09/42] backports: dissolve compat-3.10.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 10/42] backports: dissolve compat-2.6.25.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 11/42] backports: dissolve compat-3.8.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 12/42] backports: dissolve compat-3.7.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 13/42] backports: dissolve compat-3.6.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 14/42] backports: dissolve compat-3.5.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 15/42] backports: dissolve backport.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 16/42] backports: dissolve compat-3.4.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 17/42] backports: dissolve compat-3.3.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 18/42] backports: dissolve compat-3.2.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 19/42] backports: dissolve compat-3.1.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 20/42] backports: dissolve compat-3.0.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 21/42] backports: dissolve compat-2.6.39.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 22/42] backports: dissolve compat-2.6.38.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 23/42] backports: dissolve compat-2.6.37.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 24/42] backports: dissolve compat-2.6.36.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 25/42] backports: dissolve compat-2.6.35.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 26/42] backports: dissolve compat-2.6.34.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 27/42] backports: dissolve compat-2.6.33.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 28/42] backports: dissolve compat-2.6.32.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 29/42] backports: dissolve compat-2.6.31.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 30/42] backports: dissolve compat-2.6.30.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 31/42] backports: dissolve compat-2.6.29.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 32/42] backports: dissolve compat-2.6.28.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 33/42] backports: dissolve compat-2.6.27.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 34/42] backports: dissolve compat-2.6.26.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 35/42] backports: improve SIMPLE_DEV_PM_OPS macro Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 36/42] backports: avoid pr_fmt warning from our export.h Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 37/42] backports: fix USB PM in case of !CONFIG_USB_SUSPEND Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 38/42] backports: avoid module parameter warnings Johannes Berg
2013-04-13 23:53 ` [RFC/RFT 39/42] backports: avoid vfree() const warning Johannes Berg
2013-04-13 23:54 ` [RFC/RFT 40/42] backports: include hardirq into netdevice.h Johannes Berg
2013-04-13 23:54 ` [RFC/RFT 41/42] backports: add vgaarb.h Johannes Berg
2013-04-13 23:54 ` [RFC/RFT 42/42] backports: automatically backport EWMA lib Johannes Berg
2013-04-13 23:57 ` [RFC/RFT 00/42] explode header files Johannes Berg
2013-04-14  0:17 ` Johannes Berg
2013-04-15 11:16 ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.