All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/WIP 00/24] backports: disentangle header file mess
@ 2013-04-11 23:42 Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 01/24] backports: move header files Johannes Berg
                   ` (24 more replies)
  0 siblings, 25 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 UTC (permalink / raw)
  To: backports

As we were discussing, let's disentangle the header file mess
and the various random includes all over the place and instead
provide each header file that needs something backported with
those backported things and and #include_next.

The list.h stuff was a bit tricky, but not really a big issue
thanks to Hauke's idea.

I'm also removing compatibility with < 2.6.24 ... it just doesn't
seem worth it any more.

Up until patch 22 it passes ckmake --allyesconfig, but then after
that I haven't tried and clearly with patch 24 it won't, that one
can only work for kernels 3.5 and up or so since not all of the
compat headers are dissolved yet.

One of the nice things is that we can get rid of the pr_fmt mess,
that's a huge patch removal. But overall, this is also nicer as
it will better replicate the include structure of the kernel.

johannes


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

* [RFC/WIP 01/24] backports: move header files
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 02/24] backports: move br_port_exists Johannes Berg
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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 91e7dd6..a4c4f90 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 476a3fc..48d8fdd 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] 28+ messages in thread

* [RFC/WIP 02/24] backports: move br_port_exists
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 01/24] backports: move header files Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 03/24] backports: move IFF_DONT_BRIDGE Johannes Berg
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 UTC (permalink / raw)
  To: backports; +Cc: Hauke Mehrtens

From: Hauke Mehrtens <hauke@hauke-m.de>

---
 backport/backport-include/linux/compat-2.6.36.h | 15 -------------
 backport/backport-include/linux/if.h            | 28 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 15 deletions(-)
 create mode 100644 backport/backport-include/linux/if.h

diff --git a/backport/backport-include/linux/compat-2.6.36.h b/backport/backport-include/linux/compat-2.6.36.h
index ff6a53f..ae3ffa6 100644
--- a/backport/backport-include/linux/compat-2.6.36.h
+++ b/backport/backport-include/linux/compat-2.6.36.h
@@ -187,8 +187,6 @@ enum {
 #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)
@@ -199,19 +197,6 @@ 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/if.h b/backport/backport-include/linux/if.h
new file mode 100644
index 0000000..63fef8a
--- /dev/null
+++ b/backport/backport-include/linux/if.h
@@ -0,0 +1,28 @@
+#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 /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
+#endif	/* _BACKPORT_LINUX_IF_H */
-- 
1.8.0


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

* [RFC/WIP 03/24] backports: move IFF_DONT_BRIDGE
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 01/24] backports: move header files Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 02/24] backports: move br_port_exists Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 04/24] backports: move compat_pci_{suspend,resume} Johannes Berg
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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 | 6 ------
 backport/backport-include/linux/if.h            | 5 +++++
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/backport/backport-include/linux/compat-2.6.33.h b/backport/backport-include/linux/compat-2.6.33.h
index b03fe40..485072a 100644
--- a/backport/backport-include/linux/compat-2.6.33.h
+++ b/backport/backport-include/linux/compat-2.6.33.h
@@ -52,12 +52,6 @@ void release_firmware(const struct firmware *fw);
 #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)
diff --git a/backport/backport-include/linux/if.h b/backport/backport-include/linux/if.h
index 63fef8a..7147711 100644
--- a/backport/backport-include/linux/if.h
+++ b/backport/backport-include/linux/if.h
@@ -5,6 +5,11 @@
 
 #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)
-- 
1.8.0


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

* [RFC/WIP 04/24] backports: move compat_pci_{suspend,resume}
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (2 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 03/24] backports: move IFF_DONT_BRIDGE Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 05/24] backports: move simple_open() Johannes Berg
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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 | 67 ----------------------
 backport/backport-include/linux/pci.h           | 75 +++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 67 deletions(-)
 create mode 100644 backport/backport-include/linux/pci.h

diff --git a/backport/backport-include/linux/compat-2.6.29.h b/backport/backport-include/linux/compat-2.6.29.h
index c8cf898..949874e 100644
--- a/backport/backport-include/linux/compat-2.6.29.h
+++ b/backport/backport-include/linux/compat-2.6.29.h
@@ -358,73 +358,6 @@ static inline int ndo_do_ioctl(struct net_device *dev,
 
 #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/pci.h b/backport/backport-include/linux/pci.h
new file mode 100644
index 0000000..2600376
--- /dev/null
+++ b/backport/backport-include/linux/pci.h
@@ -0,0 +1,75 @@
+#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(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
+
+#endif /* _BACKPORT_LINUX_PCI_H */
-- 
1.8.0


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

* [RFC/WIP 05/24] backports: move simple_open()
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (3 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 04/24] backports: move compat_pci_{suspend,resume} Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 06/24] backports: move module_pci_driver Johannes Berg
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 UTC (permalink / raw)
  To: backports; +Cc: Hauke Mehrtens

From: Hauke Mehrtens <hauke@hauke-m.de>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-3.4.h |  3 ---
 backport/backport-include/linux/fs.h         | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 backport/backport-include/linux/fs.h

diff --git a/backport/backport-include/linux/compat-3.4.h b/backport/backport-include/linux/compat-3.4.h
index a152d51..6f655bd 100644
--- a/backport/backport-include/linux/compat-3.4.h
+++ b/backport/backport-include/linux/compat-3.4.h
@@ -102,9 +102,6 @@ static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
 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)
diff --git a/backport/backport-include/linux/fs.h b/backport/backport-include/linux/fs.h
new file mode 100644
index 0000000..db57d42
--- /dev/null
+++ b/backport/backport-include/linux/fs.h
@@ -0,0 +1,15 @@
+#ifndef _COMPAT_LINUX_FS_H
+#define _COMPAT_LINUX_FS_H
+
+#include_next <linux/fs.h>
+
+#include <linux/version.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 /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
+
+#endif	/* _COMPAT_LINUX_FS_H */
-- 
1.8.0


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

* [RFC/WIP 06/24] backports: move module_pci_driver
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (4 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 05/24] backports: move simple_open() Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 07/24] backports: move skb_add_rx_frag Johannes Berg
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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.4.h | 13 -------------
 backport/backport-include/linux/pci.h        | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/backport/backport-include/linux/compat-3.4.h b/backport/backport-include/linux/compat-3.4.h
index 6f655bd..45aef72 100644
--- a/backport/backport-include/linux/compat-3.4.h
+++ b/backport/backport-include/linux/compat-3.4.h
@@ -160,19 +160,6 @@ static inline void eth_hw_addr_random(struct net_device *dev)
 #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"
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index 2600376..1cecd98 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -72,4 +72,18 @@
 #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
+ * @__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 /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
+
 #endif /* _BACKPORT_LINUX_PCI_H */
-- 
1.8.0


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

* [RFC/WIP 07/24] backports: move skb_add_rx_frag
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (5 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 06/24] backports: move module_pci_driver Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 08/24] backports: move COMPAT_USE_64BIT_TIME Johannes Berg
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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.28.h |  3 ---
 backport/backport-include/linux/compat-3.4.h    |  8 --------
 backport/backport-include/linux/skbuff.h        | 16 ++++++++++++++++
 3 files changed, 16 insertions(+), 11 deletions(-)
 create mode 100644 backport/backport-include/linux/skbuff.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..60f56f4 100644
--- a/backport/backport-include/linux/compat-2.6.28.h
+++ b/backport/backport-include/linux/compat-2.6.28.h
@@ -276,9 +276,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
index 45aef72..fafec0c 100644
--- a/backport/backport-include/linux/compat-3.4.h
+++ b/backport/backport-include/linux/compat-3.4.h
@@ -102,14 +102,6 @@ static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
 extern const struct i2c_algorithm i2c_bit_algo;
 #endif
 
-#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))
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
new file mode 100644
index 0000000..0c09f9b
--- /dev/null
+++ b/backport/backport-include/linux/skbuff.h
@@ -0,0 +1,16 @@
+#ifndef __BACKPORT_SKBUFF_H
+#define __BACKPORT_SKBUFF_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 */
-- 
1.8.0


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

* [RFC/WIP 08/24] backports: move COMPAT_USE_64BIT_TIME
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (6 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 07/24] backports: move skb_add_rx_frag Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 09/24] backports: move eth_hw_addr_random Johannes Berg
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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.4.h |  7 -------
 backport/backport-include/linux/compat.h     | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 7 deletions(-)
 create mode 100644 backport/backport-include/linux/compat.h

diff --git a/backport/backport-include/linux/compat-3.4.h b/backport/backport-include/linux/compat-3.4.h
index fafec0c..51c058e 100644
--- a/backport/backport-include/linux/compat-3.4.h
+++ b/backport/backport-include/linux/compat-3.4.h
@@ -102,13 +102,6 @@ static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
 extern const struct i2c_algorithm i2c_bit_algo;
 #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)
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 */
-- 
1.8.0


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

* [RFC/WIP 09/24] backports: move eth_hw_addr_random
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (7 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 08/24] backports: move COMPAT_USE_64BIT_TIME Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 10/24] backports: move kernel 3.3 SKB functions Johannes Berg
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 UTC (permalink / raw)
  To: backports; +Cc: Hauke Mehrtens

From: Hauke Mehrtens <hauke@hauke-m.de>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-3.4.h  | 43 ---------------------------
 backport/backport-include/linux/etherdevice.h | 40 +++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 43 deletions(-)
 create mode 100644 backport/backport-include/linux/etherdevice.h

diff --git a/backport/backport-include/linux/compat-3.4.h b/backport/backport-include/linux/compat-3.4.h
index 51c058e..1faa5b9 100644
--- a/backport/backport-include/linux/compat-3.4.h
+++ b/backport/backport-include/linux/compat-3.4.h
@@ -102,49 +102,6 @@ static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
 extern const struct i2c_algorithm i2c_bit_algo;
 #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)) */
-
 /*
  * 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"
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
new file mode 100644
index 0000000..9f31ab2
--- /dev/null
+++ b/backport/backport-include/linux/etherdevice.h
@@ -0,0 +1,40 @@
+#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(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
+
+#endif /* _BACKPORT_LINUX_ETHERDEVICE_H */
-- 
1.8.0


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

* [RFC/WIP 10/24] backports: move kernel 3.3 SKB functions
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (8 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 09/24] backports: move eth_hw_addr_random Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 11/24] backports: move netdev_features_t Johannes Berg
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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 |  8 --------
 backport/backport-include/linux/skbuff.h     | 11 +++++++++++
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/backport/backport-include/linux/compat-3.3.h b/backport/backport-include/linux/compat-3.3.h
index ce7e776..72686da 100644
--- a/backport/backport-include/linux/compat-3.3.h
+++ b/backport/backport-include/linux/compat-3.3.h
@@ -305,14 +305,6 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
 #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;
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 0c09f9b..0a2e4cf 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -13,4 +13,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 */
-- 
1.8.0


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

* [RFC/WIP 11/24] backports: move netdev_features_t
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (9 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 10/24] backports: move kernel 3.3 SKB functions Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 12/24] backports: move module_driver() Johannes Berg
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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      |  2 --
 backport/backport-include/linux/netdev_features.h | 15 +++++++++++++++
 backport/backport-include/linux/netdevice.h       |  6 ++++++
 3 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 backport/backport-include/linux/netdev_features.h
 create mode 100644 backport/backport-include/linux/netdevice.h

diff --git a/backport/backport-include/linux/compat-3.3.h b/backport/backport-include/linux/compat-3.3.h
index 72686da..7b2ec47 100644
--- a/backport/backport-include/linux/compat-3.3.h
+++ b/backport/backport-include/linux/compat-3.3.h
@@ -307,8 +307,6 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
 
 #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
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
new file mode 100644
index 0000000..4971239
--- /dev/null
+++ b/backport/backport-include/linux/netdevice.h
@@ -0,0 +1,6 @@
+#ifndef __BACKPORT_NETDEVICE_H
+#define __BACKPORT_NETDEVICE_H
+#include_next <linux/netdevice.h>
+#include <linux/netdev_features.h>
+
+#endif /* __BACKPORT_NETDEVICE_H */
-- 
1.8.0


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

* [RFC/WIP 12/24] backports: move module_driver()
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (10 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 11/24] backports: move netdev_features_t Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 13/24] backports: move module_usb_driver() Johannes Berg
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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 | 22 --------------------
 backport/backport-include/linux/device.h     | 31 ++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 22 deletions(-)
 create mode 100644 backport/backport-include/linux/device.h

diff --git a/backport/backport-include/linux/compat-3.3.h b/backport/backport-include/linux/compat-3.3.h
index 7b2ec47..eded1bb 100644
--- a/backport/backport-include/linux/compat-3.3.h
+++ b/backport/backport-include/linux/compat-3.3.h
@@ -307,28 +307,6 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
 
 #define NL80211_FEATURE_SK_TX_STATUS 0
 
-/* 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
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
new file mode 100644
index 0000000..b46731a
--- /dev/null
+++ b/backport/backport-include/linux/device.h
@@ -0,0 +1,31 @@
+#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,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
+
+#endif /* __BACKPORT_DEVICE_H */
-- 
1.8.0


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

* [RFC/WIP 13/24] backports: move module_usb_driver()
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (11 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 12/24] backports: move module_driver() Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 14/24] backports: remove vb2_mmap_pfn_range Johannes Berg
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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 | 14 --------------
 backport/backport-include/linux/usb.h        | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+), 14 deletions(-)
 create mode 100644 backport/backport-include/linux/usb.h

diff --git a/backport/backport-include/linux/compat-3.3.h b/backport/backport-include/linux/compat-3.3.h
index eded1bb..5950e2b 100644
--- a/backport/backport-include/linux/compat-3.3.h
+++ b/backport/backport-include/linux/compat-3.3.h
@@ -307,20 +307,6 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
 
 #define NL80211_FEATURE_SK_TX_STATUS 0
 
-/* 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 :
  *
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
new file mode 100644
index 0000000..2c81e48
--- /dev/null
+++ b/backport/backport-include/linux/usb.h
@@ -0,0 +1,21 @@
+#ifndef __BACKPORT_USB_H
+#define __BACKPORT_USB_H
+
+#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
+
+#endif /* __BACKPORT_USB_H */
-- 
1.8.0


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

* [RFC/WIP 14/24] backports: remove vb2_mmap_pfn_range
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (12 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 13/24] backports: move module_usb_driver() Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-12  6:06   ` Luis R. Rodriguez
  2013-04-11 23:42 ` [RFC/WIP 15/24] backports: remove __inet_lookup_established Johannes Berg
                   ` (10 subsequent siblings)
  24 siblings, 1 reply; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

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

This doesn't seem to be used anywhere.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-3.9.h |  7 -----
 backport/compat/compat-3.9.c                 | 43 ----------------------------
 2 files changed, 50 deletions(-)

diff --git a/backport/backport-include/linux/compat-3.9.h b/backport/backport-include/linux/compat-3.9.h
index a939e0b..2a1f2da 100644
--- a/backport/backport-include/linux/compat-3.9.h
+++ b/backport/backport-include/linux/compat-3.9.h
@@ -18,13 +18,6 @@
 #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
diff --git a/backport/compat/compat-3.9.c b/backport/compat/compat-3.9.c
index 56c40d3..61a062a 100644
--- a/backport/compat/compat-3.9.c
+++ b/backport/compat/compat-3.9.c
@@ -12,49 +12,6 @@
 #include <linux/scatterlist.h>
 #include <linux/device.h>
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-/**
- * vb2_mmap_pfn_range() - map physical pages to userspace
- * @vma:	virtual memory region for the mapping
- * @paddr:	starting physical address of the memory to be mapped
- * @size:	size of the memory to be mapped
- * @vm_ops:	vm operations to be assigned to the created area
- * @priv:	private data to be associated with the area
- *
- * Returns 0 on success.
- */
-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)
-{
-	int ret;
-
-	size = min_t(unsigned long, vma->vm_end - vma->vm_start, size);
-
-	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-	ret = remap_pfn_range(vma, vma->vm_start, paddr >> PAGE_SHIFT,
-				size, vma->vm_page_prot);
-	if (ret) {
-		printk(KERN_ERR "Remapping memory failed, error: %d\n", ret);
-		return ret;
-	}
-
-	vma->vm_flags		|= VM_DONTEXPAND | VM_DONTDUMP;
-	vma->vm_private_data	= priv;
-	vma->vm_ops		= vm_ops;
-
-	vma->vm_ops->open(vma);
-
-	pr_debug("%s: mapped paddr 0x%08lx at 0x%08lx, size %ld\n",
-			__func__, paddr, vma->vm_start, size);
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(vb2_mmap_pfn_range);
-#endif
-
-
 #ifdef __sg_page_iter_next
 
 void __sg_page_iter_start(struct sg_page_iter *piter,
-- 
1.8.0


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

* [RFC/WIP 15/24] backports: remove __inet_lookup_established
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (13 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 14/24] backports: remove vb2_mmap_pfn_range Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 16/24] backports: dissolve compat-3.9.h Johannes Berg
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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] 28+ messages in thread

* [RFC/WIP 16/24] backports: dissolve compat-3.9.h
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (14 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 15/24] backports: remove __inet_lookup_established Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 17/24] backports: dissolve compat-3.10.h Johannes Berg
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

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

Move everything into the appropriate header files.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/backport/backport.h      |   1 -
 backport/backport-include/backport/new-list.h      |  29 +++
 backport/backport-include/backport/new-rculist.h   |  11 +
 backport/backport-include/backport/new-sock.h      |  13 ++
 backport/backport-include/backport/old-list.h      |  23 ++
 backport/backport-include/backport/old-rculist.h   |  13 ++
 backport/backport-include/backport/old-sock.h      |  15 ++
 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       | 236 ---------------------
 backport/backport-include/linux/device.h           |   5 +
 backport/backport-include/linux/etherdevice.h      |   2 +-
 backport/backport-include/linux/fs.h               |  16 ++
 backport/backport-include/linux/hashtable.h        |   8 +
 backport/backport-include/linux/idr.h              |  47 ++++
 backport/backport-include/linux/if_team.h          |   8 +
 backport/backport-include/linux/list.h             |   7 +
 backport/backport-include/linux/pci.h              |   3 +-
 backport/backport-include/linux/pid.h              |   8 +
 backport/backport-include/linux/platform_device.h  |  22 ++
 backport/backport-include/linux/printk.h           |  26 +++
 backport/backport-include/linux/rculist.h          |   8 +
 backport/backport-include/linux/scatterlist.h      |  51 +++++
 backport/backport-include/linux/skbuff.h           |   2 +
 backport/backport-include/linux/tty_flip.h         |  11 +
 backport/backport-include/net/ax25.h               |   6 +
 backport/backport-include/net/inet_hashtables.h    |   8 +
 backport/backport-include/net/inet_timewait_sock.h |   8 +
 backport/backport-include/net/netrom.h             |   6 +
 backport/backport-include/net/sch_generic.h        |   6 +
 backport/backport-include/net/sctp/sctp.h          |   6 +
 backport/backport-include/net/sock.h               |  13 ++
 32 files changed, 381 insertions(+), 239 deletions(-)
 create mode 100644 backport/backport-include/backport/new-list.h
 create mode 100644 backport/backport-include/backport/new-rculist.h
 create mode 100644 backport/backport-include/backport/new-sock.h
 create mode 100644 backport/backport-include/backport/old-list.h
 create mode 100644 backport/backport-include/backport/old-rculist.h
 create mode 100644 backport/backport-include/backport/old-sock.h
 delete mode 100644 backport/backport-include/linux/compat-3.9.h
 create mode 100644 backport/backport-include/linux/hashtable.h
 create mode 100644 backport/backport-include/linux/idr.h
 create mode 100644 backport/backport-include/linux/if_team.h
 create mode 100644 backport/backport-include/linux/list.h
 create mode 100644 backport/backport-include/linux/pid.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/net/ax25.h
 create mode 100644 backport/backport-include/net/inet_hashtables.h
 create mode 100644 backport/backport-include/net/inet_timewait_sock.h
 create mode 100644 backport/backport-include/net/netrom.h
 create mode 100644 backport/backport-include/net/sch_generic.h
 create mode 100644 backport/backport-include/net/sctp/sctp.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 6bbf4a7..2e21762 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -83,7 +83,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/new-list.h b/backport/backport-include/backport/new-list.h
new file mode 100644
index 0000000..54a6b41
--- /dev/null
+++ b/backport/backport-include/backport/new-list.h
@@ -0,0 +1,29 @@
+/* This is just a snippet -- cannot use include protection */
+
+#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
+ */
+#undef hlist_entry_safe
+#define hlist_entry_safe(ptr, type, member) \
+	(ptr) ? hlist_entry(ptr, type, member) : NULL
+
+#undef hlist_for_each_entry
+#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
+#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))
+
+#endif
diff --git a/backport/backport-include/backport/new-rculist.h b/backport/backport-include/backport/new-rculist.h
new file mode 100644
index 0000000..b15b183
--- /dev/null
+++ b/backport/backport-include/backport/new-rculist.h
@@ -0,0 +1,11 @@
+/* This is just a snippet -- cannot use include protection */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#undef hlist_for_each_entry_rcu
+#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))
+#endif
diff --git a/backport/backport-include/backport/new-sock.h b/backport/backport-include/backport/new-sock.h
new file mode 100644
index 0000000..38ebe5b
--- /dev/null
+++ b/backport/backport-include/backport/new-sock.h
@@ -0,0 +1,13 @@
+/* This is just a snippet -- cannot use include protection */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+
+#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)
+
+#endif
diff --git a/backport/backport-include/backport/old-list.h b/backport/backport-include/backport/old-list.h
new file mode 100644
index 0000000..d8a6de6
--- /dev/null
+++ b/backport/backport-include/backport/old-list.h
@@ -0,0 +1,23 @@
+/* This is just a snippet -- cannot use include protection */
+
+#include <linux/list.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#undef hlist_entry_safe
+#define hlist_entry_safe(ptr, type, member) \
+	(ptr) ? hlist_entry(ptr, type, member) : NULL
+
+#undef hlist_for_each_entry
+#define hlist_for_each_entry(tpos, pos, head, member)			\
+	for (pos = (head)->first;					\
+	     pos &&							\
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;});\
+	     pos = pos->next)
+
+#undef hlist_for_each_entry_safe
+#define hlist_for_each_entry_safe(tpos, pos, n, head, member)		\
+	for (pos = (head)->first;					\
+	     pos && ({ n = pos->next; 1; }) &&				\
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;});\
+	     pos = n)
+#endif
diff --git a/backport/backport-include/backport/old-rculist.h b/backport/backport-include/backport/old-rculist.h
new file mode 100644
index 0000000..9cff7af
--- /dev/null
+++ b/backport/backport-include/backport/old-rculist.h
@@ -0,0 +1,13 @@
+/* This is just a snippet -- cannot use include protection */
+
+#include <linux/rculist.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#undef hlist_for_each_entry_rcu
+#define hlist_for_each_entry_rcu(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)))
+
+#endif
diff --git a/backport/backport-include/backport/old-sock.h b/backport/backport-include/backport/old-sock.h
new file mode 100644
index 0000000..09ef9c9
--- /dev/null
+++ b/backport/backport-include/backport/old-sock.h
@@ -0,0 +1,15 @@
+/* This is just a snippet -- cannot use include protection */
+
+#include <net/sock.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+
+#undef sk_for_each
+#define sk_for_each(__sk, node, list) \
+	hlist_for_each_entry(__sk, node, list, sk_node)
+
+#undef sk_for_each_safe
+#define sk_for_each_safe(__sk, node, tmp, list) \
+	hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node)
+
+#endif
diff --git a/backport/backport-include/linux/compat-2.6.29.h b/backport/backport-include/linux/compat-2.6.29.h
index 949874e..41f8233 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 ccc43a2..a045be3 100644
--- a/backport/backport-include/linux/compat-3.6.h
+++ b/backport/backport-include/linux/compat-3.6.h
@@ -32,6 +32,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 2a1f2da..0000000
--- a/backport/backport-include/linux/compat-3.9.h
+++ /dev/null
@@ -1,236 +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>
-
-/* 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
index b46731a..4f5df9d 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -28,4 +28,9 @@ static void __exit __driver##_exit(void) \
 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);
+#endif
+
 #endif /* __BACKPORT_DEVICE_H */
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index 9f31ab2..9360aa4 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -30,7 +30,7 @@ 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)
+#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);
diff --git a/backport/backport-include/linux/fs.h b/backport/backport-include/linux/fs.h
index db57d42..b600acd 100644
--- a/backport/backport-include/linux/fs.h
+++ b/backport/backport-include/linux/fs.h
@@ -12,4 +12,20 @@ extern int simple_open(struct inode *inode, struct file *file);
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
 
+#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/hashtable.h b/backport/backport-include/linux/hashtable.h
new file mode 100644
index 0000000..f28cd55
--- /dev/null
+++ b/backport/backport-include/linux/hashtable.h
@@ -0,0 +1,8 @@
+#ifndef __BACKPORT_LINUX_HASHTABLE_H
+#define __BACKPORT_LINUX_HASHTABLE_H
+#include <backport/old-list.h>
+#include <backport/old-rculist.h>
+#include_next <linux/hashtable.h>
+#include <backport/new-list.h>
+#include <backport/new-rculist.h>
+#endif /* __BACKPORT_LINUX_HASHTABLE_H */
diff --git a/backport/backport-include/linux/idr.h b/backport/backport-include/linux/idr.h
new file mode 100644
index 0000000..650d7f8
--- /dev/null
+++ b/backport/backport-include/linux/idr.h
@@ -0,0 +1,47 @@
+#ifndef __BACKPORT_IDR_H
+#define __BACKPORT_IDR_H
+#include_next <linux/idr.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+/**
+ * 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/if_team.h b/backport/backport-include/linux/if_team.h
new file mode 100644
index 0000000..b77c338
--- /dev/null
+++ b/backport/backport-include/linux/if_team.h
@@ -0,0 +1,8 @@
+#ifndef __BACKPORT_LINUX_IF_TEAM_H
+#define __BACKPORT_LINUX_IF_TEAM_H
+#include <backport/old-list.h>
+#include <backport/old-rculist.h>
+#include_next <linux/if_team.h>
+#include <backport/new-list.h>
+#include <backport/new-rculist.h>
+#endif /* __BACKPORT_LINUX_IF_TEAM_H */
diff --git a/backport/backport-include/linux/list.h b/backport/backport-include/linux/list.h
new file mode 100644
index 0000000..9c56ee1
--- /dev/null
+++ b/backport/backport-include/linux/list.h
@@ -0,0 +1,7 @@
+#ifndef __BACKPORT_LIST_H
+#define __BACKPORT_LIST_H
+#include_next <linux/list.h>
+#include <linux/version.h>
+#include <backport/new-list.h>
+
+#endif /* __BACKPORT_LIST_H */
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index 1cecd98..54bcda1 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -1,7 +1,8 @@
 #ifndef _BACKPORT_LINUX_PCI_H
 #define _BACKPORT_LINUX_PCI_H
-
+#include <backport/old-list.h>
 #include_next <linux/pci.h>
+#include <backport/new-list.h>
 
 #include <linux/version.h>
 
diff --git a/backport/backport-include/linux/pid.h b/backport/backport-include/linux/pid.h
new file mode 100644
index 0000000..8f4ea18
--- /dev/null
+++ b/backport/backport-include/linux/pid.h
@@ -0,0 +1,8 @@
+#ifndef __BACKPORT_LINUX_PID_H
+#define __BACKPORT_LINUX_PID_H
+#include <backport/old-list.h>
+#include <backport/old-rculist.h>
+#include_next <linux/pid.h>
+#include <backport/new-list.h>
+#include <backport/new-rculist.h>
+#endif /* __BACKPORT_LINUX_PID_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..b0bf931
--- /dev/null
+++ b/backport/backport-include/linux/rculist.h
@@ -0,0 +1,8 @@
+#ifndef __BACKPORT_RCULIST_H
+#define __BACKPORT_RCULIST_H
+#undef hlist_for_each_entry_rcu
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+#include_next <linux/rculist.h>
+#endif
+#include <backport/new-rculist.h>
+#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/skbuff.h b/backport/backport-include/linux/skbuff.h
index 0a2e4cf..e8ff5ac 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -1,5 +1,7 @@
 #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,
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/net/ax25.h b/backport/backport-include/net/ax25.h
new file mode 100644
index 0000000..f71f34e
--- /dev/null
+++ b/backport/backport-include/net/ax25.h
@@ -0,0 +1,6 @@
+#ifndef __BACKPORT_NET_AX25_H
+#define __BACKPORT_NET_AX25_H
+#include <backport/old-list.h>
+#include_next <net/ax25.h>
+#include <backport/new-list.h>
+#endif /* __BACKPORT_NET_AX25_H */
diff --git a/backport/backport-include/net/inet_hashtables.h b/backport/backport-include/net/inet_hashtables.h
new file mode 100644
index 0000000..3b41cdb
--- /dev/null
+++ b/backport/backport-include/net/inet_hashtables.h
@@ -0,0 +1,8 @@
+#ifndef __BACKPORT_NET_INET_HASHTABLES_H
+#define __BACKPORT_NET_INET_HASHTABLES_H
+#include <backport/old-list.h>
+#include <backport/old-sock.h>
+#include_next <net/inet_hashtables.h>
+#include <backport/new-list.h>
+#include <backport/new-sock.h>
+#endif /* __BACKPORT_NET_INET_HASHTABLES_H */
diff --git a/backport/backport-include/net/inet_timewait_sock.h b/backport/backport-include/net/inet_timewait_sock.h
new file mode 100644
index 0000000..28f1c58
--- /dev/null
+++ b/backport/backport-include/net/inet_timewait_sock.h
@@ -0,0 +1,8 @@
+#ifndef __BACKPORT_NET_INET_TIMEWAIT_SOCK_H
+#define __BACKPORT_NET_INET_TIMEWAIT_SOCK_H
+#include <backport/old-list.h>
+#include <backport/old-sock.h>
+#include_next <net/inet_timewait_sock.h>
+#include <backport/new-list.h>
+#include <backport/new-sock.h>
+#endif /* __BACKPORT_NET_INET_TIMEWAIT_SOCK_H */
diff --git a/backport/backport-include/net/netrom.h b/backport/backport-include/net/netrom.h
new file mode 100644
index 0000000..900806d
--- /dev/null
+++ b/backport/backport-include/net/netrom.h
@@ -0,0 +1,6 @@
+#ifndef __BACKPORT_NET_NETROM_H
+#define __BACKPORT_NET_NETROM_H
+#include <backport/old-list.h>
+#include_next <net/netrom.h>
+#include <backport/new-list.h>
+#endif /* __BACKPORT_NET_NETROM_H */
diff --git a/backport/backport-include/net/sch_generic.h b/backport/backport-include/net/sch_generic.h
new file mode 100644
index 0000000..514a461
--- /dev/null
+++ b/backport/backport-include/net/sch_generic.h
@@ -0,0 +1,6 @@
+#ifndef __BACKPORT_NET_SCH_GENERIC_H
+#define __BACKPORT_NET_SCH_GENERIC_H
+#include <backport/old-list.h>
+#include_next <net/sch_generic.h>
+#include <backport/new-list.h>
+#endif /* __BACKPORT_NET_SCH_GENERIC_H */
diff --git a/backport/backport-include/net/sctp/sctp.h b/backport/backport-include/net/sctp/sctp.h
new file mode 100644
index 0000000..3d8a4ab
--- /dev/null
+++ b/backport/backport-include/net/sctp/sctp.h
@@ -0,0 +1,6 @@
+#ifndef __BACKPORT_NET_SCTP_SCTP_H
+#define __BACKPORT_NET_SCTP_SCTP_H
+#include <backport/old-list.h>
+#include_next <net/sctp/sctp.h>
+#include <backport/new-list.h>
+#endif /* __BACKPORT_NET_SCTP_SCTP_H */
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
new file mode 100644
index 0000000..d16f59b
--- /dev/null
+++ b/backport/backport-include/net/sock.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_NET_SOCK_H
+#define __BACKPORT_NET_SOCK_H
+#include <linux/version.h>
+
+#include <backport/old-list.h>
+#include <backport/old-rculist.h>
+#include <backport/old-sock.h>
+#include_next <net/sock.h>
+#include <backport/new-list.h>
+#include <backport/new-rculist.h>
+#include <backport/new-sock.h>
+
+#endif /* __BACKPORT_NET_SOCK_H */
-- 
1.8.0


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

* [RFC/WIP 17/24] backports: dissolve compat-3.10.h
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (15 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 16/24] backports: dissolve compat-3.9.h Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 18/24] backports: remove support for < 2.6.24 Johannes Berg
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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         |  11 ++
 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, 170 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/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 2e21762..e2c44d1 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -83,7 +83,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
index 54bcda1..9a6d2b5 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -87,4 +87,15 @@
 		       pci_unregister_driver)
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
 
+#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 d16f59b..ceef0f4 100644
--- a/backport/backport-include/net/sock.h
+++ b/backport/backport-include/net/sock.h
@@ -10,4 +10,15 @@
 #include <backport/new-rculist.h>
 #include <backport/new-sock.h>
 
+#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] 28+ messages in thread

* [RFC/WIP 18/24] backports: remove support for < 2.6.24
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (16 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 17/24] backports: dissolve compat-3.10.h Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 19/24] backports: dissolve compat-2.6.25.h Johannes Berg
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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 e2c44d1..a50e488 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] 28+ messages in thread

* [RFC/WIP 19/24] backports: dissolve compat-2.6.25.h
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (17 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 18/24] backports: remove support for < 2.6.24 Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 20/24] backports: move netdev_attach_ops/ndo_do_ioctl Johannes Berg
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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        |   7 +
 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/compat-2.6.32.c                    |  48 ----
 backport/compat/main.c                             |   1 +
 19 files changed, 325 insertions(+), 381 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/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 60f56f4..12b644f 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 4f5df9d..058f3da 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,3,0)
 /**
  * module_driver() - Helper macro for drivers that don't do anything
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
index 4971239..5922f81 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -3,4 +3,11 @@
 #include_next <linux/netdevice.h>
 #include <linux/netdev_features.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 9a6d2b5..e78865f 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -6,6 +6,15 @@
 
 #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(2,6,29)
 #define compat_pci_suspend(fn)						\
 	int fn##_compat(struct pci_dev *pdev, pm_message_t state) 	\
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/compat-2.6.32.c b/backport/compat/compat-2.6.32.c
index b5a66a8..07fb314 100644
--- a/backport/compat/compat-2.6.32.c
+++ b/backport/compat/compat-2.6.32.c
@@ -69,54 +69,6 @@ int __dev_addr_delete(struct dev_addr_list **list, int *count,
 	return -ENOENT;
 }
 
-int __dev_addr_sync(struct dev_addr_list **to, int *to_count,
-		    struct dev_addr_list **from, int *from_count)
-{
-	struct dev_addr_list *da, *next;
-	int err = 0;
-
-	da = *from;
-	while (da != NULL) {
-		next = da->next;
-		if (!da->da_synced) {
-			err = __dev_addr_add(to, to_count,
-					     da->da_addr, da->da_addrlen, 0);
-			if (err < 0)
-				break;
-			da->da_synced = 1;
-			da->da_users++;
-		} else if (da->da_users == 1) {
-			__dev_addr_delete(to, to_count,
-					  da->da_addr, da->da_addrlen, 0);
-			__dev_addr_delete(from, from_count,
-					  da->da_addr, da->da_addrlen, 0);
-		}
-		da = next;
-	}
-	return err;
-}
-EXPORT_SYMBOL_GPL(__dev_addr_sync);
-
-void __dev_addr_unsync(struct dev_addr_list **to, int *to_count,
-		       struct dev_addr_list **from, int *from_count)
-{
-	struct dev_addr_list *da, *next;
-
-	da = *from;
-	while (da != NULL) {
-		next = da->next;
-		if (da->da_synced) {
-			__dev_addr_delete(to, to_count,
-					  da->da_addr, da->da_addrlen, 0);
-			da->da_synced = 0;
-			__dev_addr_delete(from, from_count,
-					  da->da_addr, da->da_addrlen, 0);
-		}
-		da = next;
-	}
-}
-EXPORT_SYMBOL_GPL(__dev_addr_unsync);
-
 /*
  * Nonzero if YEAR is a leap year (every 4 years,
  * except every 100th isn't, and every 400th is).
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] 28+ messages in thread

* [RFC/WIP 20/24] backports: move netdev_attach_ops/ndo_do_ioctl
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (18 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 19/24] backports: dissolve compat-2.6.25.h Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 21/24] backports: dissolve compat-3.8.h Johannes Berg
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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 | 31 ------------------------
 backport/backport-include/linux/netdevice.h     | 32 +++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 31 deletions(-)

diff --git a/backport/backport-include/linux/compat-2.6.29.h b/backport/backport-include/linux/compat-2.6.29.h
index 41f8233..3104a23 100644
--- a/backport/backport-include/linux/compat-2.6.29.h
+++ b/backport/backport-include/linux/compat-2.6.29.h
@@ -236,20 +236,6 @@ struct net_device_ops {
 #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
@@ -340,23 +326,6 @@ extern int		init_dummy_netdev(struct net_device *dev);
 
 /* 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)) */
 
 #define  PCI_EXP_SLTSTA_PDS	0x0040  /* Presence Detect State */
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 5922f81..2ec1497 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -10,4 +10,36 @@ 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
+
 #endif /* __BACKPORT_NETDEVICE_H */
-- 
1.8.0


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

* [RFC/WIP 21/24] backports: dissolve compat-3.8.h
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (19 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 20/24] backports: move netdev_attach_ops/ndo_do_ioctl Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 22/24] backports: dissolve compat-3.7.h Johannes Berg
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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            |  21 ++++
 backport/backport-include/linux/mod_devicetable.h |  13 +++
 backport/backport-include/linux/netdevice.h       |   7 ++
 backport/backport-include/linux/pci_regs.h        |  29 +++++
 backport/backport-include/linux/random.h          |  13 +++
 9 files changed, 160 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..3da34f4
--- /dev/null
+++ b/backport/backport-include/linux/kref.h
@@ -0,0 +1,21 @@
+#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)
+/* 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 2ec1497..480be4a 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -2,6 +2,13 @@
 #define __BACKPORT_NETDEVICE_H
 #include_next <linux/netdevice.h>
 #include <linux/netdev_features.h>
+#include <linux/version.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)
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] 28+ messages in thread

* [RFC/WIP 22/24] backports: dissolve compat-3.7.h
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (20 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 21/24] backports: dissolve compat-3.8.h Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 23/24] backports: dissolve compat-3.6.h Johannes Berg
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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      | 216 ----------------------
 backport/backport-include/linux/etherdevice.h     |  16 ++
 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        |  33 ++++
 backport/backport-include/linux/tty.h             |  15 ++
 backport/backport-include/linux/workqueue.h       |  12 ++
 backport/backport-include/net/genetlink.h         |  12 ++
 backport/backport-include/net/netlink.h           |  96 ++++++++++
 backport/compat/compat-3.7.c                      |   2 +
 14 files changed, 263 insertions(+), 217 deletions(-)
 delete mode 100644 backport/backport-include/linux/compat-3.7.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 96662e3..0000000
--- a/backport/backport-include/linux/compat-3.7.h
+++ /dev/null
@@ -1,216 +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
-
-#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
index 9360aa4..6a657e6 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -37,4 +37,20 @@ static inline void eth_hw_addr_random(struct net_device *dev)
 }
 #endif
 
+#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/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 e78865f..9537332 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -96,6 +96,47 @@ int __must_check pci_enable_device_mem(struct pci_dev *dev);
 		       pci_unregister_driver)
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
 
+#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..0ee8ae2
--- /dev/null
+++ b/backport/backport-include/linux/seq_file.h
@@ -0,0 +1,33 @@
+#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>
+#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..3aa10eb
--- /dev/null
+++ b/backport/backport-include/linux/tty.h
@@ -0,0 +1,15 @@
+#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 */
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)
-- 
1.8.0


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

* [RFC/WIP 23/24] backports: dissolve compat-3.6.h
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (21 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 22/24] backports: dissolve compat-3.7.h Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-11 23:42 ` [RFC/WIP 24/24] backports: don't include backports.h any more Johannes Berg
  2013-04-12  6:10 ` [RFC/WIP 00/24] backports: disentangle header file mess Luis R. Rodriguez
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 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       | 138 ---------------------
 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              |  20 +++
 backport/backport-include/net/genetlink.h          |   4 +
 11 files changed, 175 insertions(+), 139 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

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 a045be3..0000000
--- a/backport/backport-include/linux/compat-3.6.h
+++ /dev/null
@@ -1,138 +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>
-/* 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 6a657e6..031a3c0 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -37,6 +37,34 @@ static inline void eth_hw_addr_random(struct net_device *dev)
 }
 #endif
 
+#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
index 2c81e48..9485d37 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -18,4 +18,24 @@
 		       usb_deregister)
 #endif
 
+#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] 28+ messages in thread

* [RFC/WIP 24/24] backports: don't include backports.h any more
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (22 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 23/24] backports: dissolve compat-3.6.h Johannes Berg
@ 2013-04-11 23:42 ` Johannes Berg
  2013-04-12  6:10 ` [RFC/WIP 00/24] backports: disentangle header file mess Luis R. Rodriguez
  24 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-11 23:42 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

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

(WIP, needs all other compat-*.h files dissolved)

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.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/Makefile.kernel                           |   1 -
 backport/backport-include/backport/backport.h      |  82 ----------
 backport/backport-include/generated/autoconf.h     |  11 ++
 backport/backport-include/linux/autoconf.h         |   2 +
 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/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 ---------------------
 77 files changed, 52 insertions(+), 1174 deletions(-)
 delete mode 100644 backport/backport-include/backport/backport.h
 create mode 100644 backport/backport-include/generated/autoconf.h
 create mode 100644 backport/backport-include/linux/autoconf.h
 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/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/Makefile.kernel b/backport/Makefile.kernel
index a4c4f90..a99e1d2 100644
--- a/backport/Makefile.kernel
+++ b/backport/Makefile.kernel
@@ -8,7 +8,6 @@ NOSTDINC_FLAGS := \
 	-I$(M)/include/ \
 	-I$(M)/include/uapi \
 	-I$(M)/include/drm \
-	-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/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
deleted file mode 100644
index c5c194e..0000000
--- a/backport/backport-include/backport/backport.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef LINUX_BACKPORT_H
-#define LINUX_BACKPORT_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 */
diff --git a/backport/backport-include/generated/autoconf.h b/backport/backport-include/generated/autoconf.h
new file mode 100644
index 0000000..0971382
--- /dev/null
+++ b/backport/backport-include/generated/autoconf.h
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_GENERATED_AUTOCONF_H
+#define __BACKPORT_GENERATED_AUTOCONF_H
+#include_next <generated/autoconf.h>
+#include <backport/autoconf.h>
+
+#ifndef __ASSEMBLY__
+#define LINUX_BACKPORT(__sym) backport_ ##__sym
+#include <backport/checks.h>
+#endif
+
+#endif /* __BACKPORT_GENERATED_AUTOCONF_H */
diff --git a/backport/backport-include/linux/autoconf.h b/backport/backport-include/linux/autoconf.h
new file mode 100644
index 0000000..10bad72
--- /dev/null
+++ b/backport/backport-include/linux/autoconf.h
@@ -0,0 +1,2 @@
+/* older kernels used this filename -- use the one one: */
+#include <generated/autoconf.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/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] 28+ messages in thread

* Re: [RFC/WIP 14/24] backports: remove vb2_mmap_pfn_range
  2013-04-11 23:42 ` [RFC/WIP 14/24] backports: remove vb2_mmap_pfn_range Johannes Berg
@ 2013-04-12  6:06   ` Luis R. Rodriguez
  2013-04-12  7:37     ` Johannes Berg
  0 siblings, 1 reply; 28+ messages in thread
From: Luis R. Rodriguez @ 2013-04-12  6:06 UTC (permalink / raw)
  To: Johannes Berg; +Cc: backports, Johannes Berg

On Thu, Apr 11, 2013 at 4:42 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> This doesn't seem to be used anywhere.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

I need this for media.

 Luis

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

* Re: [RFC/WIP 00/24] backports: disentangle header file mess
  2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
                   ` (23 preceding siblings ...)
  2013-04-11 23:42 ` [RFC/WIP 24/24] backports: don't include backports.h any more Johannes Berg
@ 2013-04-12  6:10 ` Luis R. Rodriguez
  24 siblings, 0 replies; 28+ messages in thread
From: Luis R. Rodriguez @ 2013-04-12  6:10 UTC (permalink / raw)
  To: Johannes Berg; +Cc: backports

On Thu, Apr 11, 2013 at 4:42 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> As we were discussing, let's disentangle the header file mess
> and the various random includes all over the place and instead
> provide each header file that needs something backported with
> those backported things and and #include_next.
>
> The list.h stuff was a bit tricky, but not really a big issue
> thanks to Hauke's idea.
>
> I'm also removing compatibility with < 2.6.24 ... it just doesn't
> seem worth it any more.
>
> Up until patch 22 it passes ckmake --allyesconfig, but then after
> that I haven't tried and clearly with patch 24 it won't, that one
> can only work for kernels 3.5 and up or so since not all of the
> compat headers are dissolved yet.
>
> One of the nice things is that we can get rid of the pr_fmt mess,
> that's a huge patch removal. But overall, this is also nicer as
> it will better replicate the include structure of the kernel.

I'm supportive of the switch.

  Luis

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

* Re: [RFC/WIP 14/24] backports: remove vb2_mmap_pfn_range
  2013-04-12  6:06   ` Luis R. Rodriguez
@ 2013-04-12  7:37     ` Johannes Berg
  0 siblings, 0 replies; 28+ messages in thread
From: Johannes Berg @ 2013-04-12  7:37 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

On Thu, 2013-04-11 at 23:06 -0700, Luis R. Rodriguez wrote:
> On Thu, Apr 11, 2013 at 4:42 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > This doesn't seem to be used anywhere.
> >
> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> 
> I need this for media.

Ok, I'll replace this patch with:


>From 523e3db02047519f879f9b141919eab8a5c4c628 Mon Sep 17 00:00:00 2001
From: Johannes Berg <johannes.berg@intel.com>
Date: Thu, 11 Apr 2013 20:48:09 +0200
Subject: [PATCH] backports: move vb2_mmap_pfn_range

The new code uses vb2_common_vm_ops which is in
include/media/videobuf2-memops.h so put this
there as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/compat-3.9.h       |  7 -------
 backport/backport-include/media/videobuf2-memops.h | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 7 deletions(-)
 create mode 100644 backport/backport-include/media/videobuf2-memops.h

diff --git a/backport/backport-include/linux/compat-3.9.h
b/backport/backport-include/linux/compat-3.9.h
index a939e0b..2a1f2da 100644
--- a/backport/backport-include/linux/compat-3.9.h
+++ b/backport/backport-include/linux/compat-3.9.h
@@ -18,13 +18,6 @@
 #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
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 */
-- 
1.8.0




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

end of thread, other threads:[~2013-04-12  7:37 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-11 23:42 [RFC/WIP 00/24] backports: disentangle header file mess Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 01/24] backports: move header files Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 02/24] backports: move br_port_exists Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 03/24] backports: move IFF_DONT_BRIDGE Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 04/24] backports: move compat_pci_{suspend,resume} Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 05/24] backports: move simple_open() Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 06/24] backports: move module_pci_driver Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 07/24] backports: move skb_add_rx_frag Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 08/24] backports: move COMPAT_USE_64BIT_TIME Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 09/24] backports: move eth_hw_addr_random Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 10/24] backports: move kernel 3.3 SKB functions Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 11/24] backports: move netdev_features_t Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 12/24] backports: move module_driver() Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 13/24] backports: move module_usb_driver() Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 14/24] backports: remove vb2_mmap_pfn_range Johannes Berg
2013-04-12  6:06   ` Luis R. Rodriguez
2013-04-12  7:37     ` Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 15/24] backports: remove __inet_lookup_established Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 16/24] backports: dissolve compat-3.9.h Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 17/24] backports: dissolve compat-3.10.h Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 18/24] backports: remove support for < 2.6.24 Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 19/24] backports: dissolve compat-2.6.25.h Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 20/24] backports: move netdev_attach_ops/ndo_do_ioctl Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 21/24] backports: dissolve compat-3.8.h Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 22/24] backports: dissolve compat-3.7.h Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 23/24] backports: dissolve compat-3.6.h Johannes Berg
2013-04-11 23:42 ` [RFC/WIP 24/24] backports: don't include backports.h any more Johannes Berg
2013-04-12  6:10 ` [RFC/WIP 00/24] backports: disentangle header file mess Luis R. Rodriguez

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.